Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions class-languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function options() {
**/
public function set_active_langs( $lang_codes ) {
$this->parse_available_languages();
error_log( "SW: WP_LANG_DIR: " . WP_LANG_DIR );
bbl_log( "SW: WP_LANG_DIR: " . WP_LANG_DIR );
$this->active_langs = $lang_codes;
}

Expand Down Expand Up @@ -357,9 +357,9 @@ protected function maybe_process_languages() {
}
$lang_prefs[ $code ] = $lang_pref;
}
error_log( "SW: Available langs: " . print_r( $this->available_langs, true ) );
error_log( "SW: Lang prefs: " . print_r( $lang_prefs, true ) );

bbl_log( "SW: Available langs: " . print_r( $this->available_langs, true ) );
bbl_log( "SW: Lang prefs: " . print_r( $lang_prefs, true ) );

// Now save the active languages, i.e. the selected languages

Expand Down
4 changes: 2 additions & 2 deletions class-locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,11 @@ protected function maybe_update() {
return;

if ( $version < 1 ) {
error_log( "Babble Locale: Flushing rewrite rules" );
bbl_log( "Babble Locale: Flushing rewrite rules" );
flush_rewrite_rules();
}

error_log( "Babble Locale: Done updates" );
bbl_log( "Babble Locale: Done updates" );
update_option( $option_name, $this->version );
}

Expand Down
6 changes: 3 additions & 3 deletions class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function setup( $name = '', $type = null ) {
$this->url = trailingslashit( $plugins_url );
} else {
// WTF?
error_log( 'PLUGIN/THEME ERROR: Cannot find ' . $plugins_dir . ' or "themes" in ' . $file );
bbl_log( 'PLUGIN/THEME ERROR: Cannot find ' . $plugins_dir . ' or "themes" in ' . $file );
}

// Suffix for enqueuing
Expand Down Expand Up @@ -302,7 +302,7 @@ protected function render_admin( $template_file, $vars = null ) {
require( $this->dir( "templates-admin/$template_file" ) );
} else {
$msg = sprintf( __( "This plugin admin template could not be found: %s" ), $this->dir( "templates-admin/$template_file" ) );
error_log( "Plugin template error: $msg" );
bbl_log( "Plugin template error: $msg" );
echo "<p style='background-color: #ffa; border: 1px solid red; color: #300; padding: 10px;'>$msg</p>";
}
}
Expand Down Expand Up @@ -440,7 +440,7 @@ protected function locate_template( $template_file ) {
return $this->dir( "templates/$template_file" );
// Oh dear. We can't find the template.
$msg = sprintf( __( "This plugin template could not be found, perhaps you need to hook `sil_plugins_dir` and `sil_plugins_url`: %s" ), $this->dir( "templates/$template_file" ) );
error_log( "Template error: $msg" );
bbl_log( "Template error: $msg" );
echo "<p style='background-color: #ffa; border: 1px solid red; color: #300; padding: 10px;'>$msg</p>";
}

Expand Down
18 changes: 9 additions & 9 deletions class-post-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function registered_post_type( $post_type, $args ) {

$result = register_post_type( $new_post_type, $new_args );
if ( is_wp_error( $result ) ) {
error_log( "Error creating shadow post_type for $new_post_type: " . print_r( $result, true ) );
bbl_log( "Error creating shadow post_type for $new_post_type: " . print_r( $result, true ) );
} else {
$this->post_types[ $new_post_type ] = $post_type;
$this->lang_map[ $new_post_type ] = $lang->code;
Expand Down Expand Up @@ -1212,7 +1212,7 @@ public function get_post_translations( $post ) {

# @TODO A transid should never be a wp_error. Check and fix.
if ( is_wp_error( $transid ) )
error_log( "Error getting transid: " . print_r( $transid, true ) );
bbl_log( "Error getting transid: " . print_r( $transid, true ) );
$post_ids = get_objects_in_term( $transid, 'post_translation' );

// Work out all the translated equivalent post types
Expand Down Expand Up @@ -1532,15 +1532,15 @@ function set_transid( $post, $transid = false ) {
$transid_name = 'post_transid_' . uniqid();
$result = wp_insert_term( $transid_name, 'post_translation', array() );
if ( is_wp_error( $result ) )
error_log( "Problem creating a new Post TransID: " . print_r( $result, true ) );
bbl_log( "Problem creating a new Post TransID: " . print_r( $result, true ) );
else
$transid = $result[ 'term_id' ];
// Delete anything in there currently
wp_cache_delete( $transid, 'bbl_post_translations' );
}
$result = wp_set_object_terms( $post->ID, $transid, 'post_translation' );
if ( is_wp_error( $result ) )
error_log( "Problem associating TransID with new posts: " . print_r( $result, true ) );
bbl_log( "Problem associating TransID with new posts: " . print_r( $result, true ) );

$this->clean_post_cache( $post->ID );

Expand Down Expand Up @@ -1650,25 +1650,25 @@ protected function maybe_upgrade() {
$time_diff = time() - $start_time;
// Check the lock is less than 30 mins old, and if it is, bail
if ( $time_diff < ( 60 * 30 ) ) {
error_log( "Babble Post Public: Existing update routine has been running for less than 30 minutes" );
bbl_log( "Babble Post Public: Existing update routine has been running for less than 30 minutes" );
return;
}
error_log( "Babble Post Public: Update routine is running, but older than 30 minutes; going ahead regardless" );
bbl_log( "Babble Post Public: Update routine is running, but older than 30 minutes; going ahead regardless" );
} else {
add_option( "{$option_name}_running", time(), null, 'no' );
}

if ( $version < 9 ) {
error_log( "Babble Post Public: Start pruning metadata" );
bbl_log( "Babble Post Public: Start pruning metadata" );
$this->prune_post_meta();
error_log( "Babble Post Public: Remove excess post meta" );
bbl_log( "Babble Post Public: Remove excess post meta" );
}

// N.B. Remember to increment $this->version above when you add a new IF

update_option( $option_name, $this->version );
delete_option( "{$option_name}_running", true, null, 'no' );
error_log( "Babble Post Public: Done upgrade, now at version " . $this->version );
bbl_log( "Babble Post Public: Done upgrade, now at version " . $this->version );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions class-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -956,15 +956,15 @@ public function set_transid( $target_term_id, $transid = null ) {
$transid_name = 'term_transid_' . uniqid();
$result = wp_insert_term( $transid_name, 'term_translation', array() );
if ( is_wp_error( $result ) ) {
error_log( "Problem creating a new Term TransID: " . print_r( $result, true ) );
bbl_log( "Problem creating a new Term TransID: " . print_r( $result, true ) );
} else {
$transid = $result[ 'term_id' ];
}
}

$result = wp_set_object_terms( $target_term_id, absint( $transid ), 'term_translation' );
if ( is_wp_error( $result ) ) {
error_log( "Problem associating TransID with new posts: " . print_r( $result, true ) );
bbl_log( "Problem associating TransID with new posts: " . print_r( $result, true ) );
}

wp_cache_delete( $target_term_id, 'bbl_term_transids' );
Expand Down
2 changes: 1 addition & 1 deletion translation-group-tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function pre_sync_properties( $postdata, $origin_id ) {
$referer = $_SERVER[ 'HTTP_REFERER' ];
$lang = bbl_get_current_lang_code();
$origin_lang = bbl_get_post_lang_code( $origin_id );
error_log( "Babble: $user->user_login has changed {$postdata[ 'ID' ]} parent from $current_post->post_parent ($current_post->post_type) to {$postdata[ 'post_parent' ]}. \tOrigin: $origin_id. Origin lang: $origin_lang. IP $remote_ip. User lang: $lang. Referer $referer." );
bbl_log( "Babble: $user->user_login has changed {$postdata[ 'ID' ]} parent from $current_post->post_parent ($current_post->post_type) to {$postdata[ 'post_parent' ]}. \tOrigin: $origin_id. Origin lang: $origin_lang. IP $remote_ip. User lang: $lang. Referer $referer." );
}
return $postdata;
}
Expand Down