diff --git a/class-languages.php b/class-languages.php index 29b0e3a..2bc921b 100644 --- a/class-languages.php +++ b/class-languages.php @@ -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; } @@ -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 diff --git a/class-locale.php b/class-locale.php index a42a870..79f65fb 100755 --- a/class-locale.php +++ b/class-locale.php @@ -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 ); } diff --git a/class-plugin.php b/class-plugin.php index cbfb6ec..1ede29d 100644 --- a/class-plugin.php +++ b/class-plugin.php @@ -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 @@ -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 "
$msg
"; } } @@ -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 "$msg
"; } diff --git a/class-post-public.php b/class-post-public.php index 34f1efd..e962949 100644 --- a/class-post-public.php +++ b/class-post-public.php @@ -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; @@ -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 @@ -1532,7 +1532,7 @@ 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 @@ -1540,7 +1540,7 @@ function set_transid( $post, $transid = false ) { } $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 ); @@ -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 ); } /** diff --git a/class-taxonomy.php b/class-taxonomy.php index 2535a18..0280dc2 100644 --- a/class-taxonomy.php +++ b/class-taxonomy.php @@ -956,7 +956,7 @@ 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' ]; } @@ -964,7 +964,7 @@ public function set_transid( $target_term_id, $transid = null ) { $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' ); diff --git a/translation-group-tool.php b/translation-group-tool.php index 95adbca..68a877d 100644 --- a/translation-group-tool.php +++ b/translation-group-tool.php @@ -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; }