Guest User

Suggestions From Themecat_Info

a guest
Jul 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.18 KB | None | 0 0
  1. For This:
  2. > WARNING: Found register_widget( in the file inc/widgets/class-popo-widgets-manager.php. Custom widgets are plugin territory.
  3. > Line 165: register_widget($class);
  4. > Line 172: register_widget($class);
  5. > WARNING: Found register_widget( in the file inc/shortcodes/class-popo-shortcodes-manager.php. Custom widgets are plugin territory.
  6. > Line 263: register_widget($shortcode['widget_class']);
  7.  
  8. create a function in your theme plugins if you have a theme supported custom plugin, if not, so please create a custom plugin for your theme.
  9.  
  10. Now create a function like
  11.  
  12.     function theme_name_function_name($class){
  13.            register_widget($class);
  14.     }
  15.  
  16. and call into your theme
  17.  
  18.     if(function_exists('theme_name_function_name')){
  19.         foreach($plugin_array as $plugin){
  20.              theme_name_function_name( $plugin);
  21.         }
  22.     }
  23.  
  24.  
  25. for this:
  26.  
  27. > WARNING: Found @file in the file inc/admin/class-popo-admin-importexport.php. Possible error suppression is being used.
  28. > Line 56: if (false === ($options_upload = @file_put_contents($xml_dir, $xml))) {
  29. > Line 57: $options_upload = @file_put_contents_fix($xml_dir, $xml);
  30. > Line 75: if (false === ($options_upload = @file_put_contents($options_dir, json_encode($popo_options)))) {
  31. > Line 76: $options_upload = @file_put_contents_fix($options_dir, json_encode($popo_options));
  32. > Line 196: if (false === ($json_options = @file_get_contents($fileurl))) {
  33. > Line 341: if (false === ($options_upload = @file_put_contents($json_dir, $response['body']))) {
  34. > Line 342: $options_upload = @file_put_contents_fix($json_dir, $response['body']);
  35. > Line 370: if (false === ($options_upload = @file_put_contents($revslider_dir, $response['body']))) {
  36. > Line 371: $options_upload = @file_put_contents_fix($revslider_dir, $response['body']);
  37. > Line 391: if (false === ($options_upload = @file_put_contents($content_dir, $response['body']))) {
  38. > Line 392: $options_upload = @file_put_contents_fix($content_dir, $response['body']);
  39.  
  40. WARNING: fwrite was found in the file inc/popocore/functions.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  41. Line 46: fwrite($fp, $filedata);
  42. WARNING: fopen was found in the file inc/popocore/parsers.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  43. Line 481: $fp = $this->fopen($file, 'r');
  44. Line 735: public function fopen($filename, $mode = 'r')
  45. Line 740: return fopen($filename, $mode);
  46. WARNING: fopen was found in the file inc/popocore/functions.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  47. Line 45: if ($fp = fopen($filename, 'wb')) {
  48. WARNING: file_put_contents was found in the file inc/admin/class-popo-admin-importexport.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  49. Line 56: if (false === ($options_upload = @file_put_contents($xml_dir, $xml))) {
  50. Line 57: $options_upload = @file_put_contents_fix($xml_dir, $xml);
  51. Line 75: if (false === ($options_upload = @file_put_contents($options_dir, json_encode($popo_options)))) {
  52. Line 76: $options_upload = @file_put_contents_fix($options_dir, json_encode($popo_options));
  53. Line 341: if (false === ($options_upload = @file_put_contents($json_dir, $response['body']))) {
  54. Line 342: $options_upload = @file_put_contents_fix($json_dir, $response['body']);
  55. Line 370: if (false === ($options_upload = @file_put_contents($revslider_dir, $response['body']))) {
  56. Line 371: $options_upload = @file_put_contents_fix($revslider_dir, $response['body']);
  57. Line 391: if (false === ($options_upload = @file_put_contents($content_dir, $response['body']))) {
  58. Line 392: $options_upload = @file_put_contents_fix($content_dir, $response['body']);
  59.  
  60. use WordPress default functions or class like this. it is our theme function with WP_Filesystem methods, you need to modified with your requirements.
  61.  
  62. function file_errors() {
  63.     $script
  64.         = 'jQuery(document).ready(function($){
  65.            alert("File system have an error. Please check your file system thank you.");
  66.                });';
  67.     wp_add_inline_script( 'crazyhour-script', $script );
  68.  
  69.     return;
  70. }
  71.  
  72. function crazyhour_compress( $style = '', $files = array(), $file_types, $new_file ) {
  73.  
  74.     /**
  75.      * On-the-fly CSS Compression
  76.      * Copyright (c) 2017 and onwards, Abdul Hanna Ishfaq Ahmad.
  77.      */
  78.     require_once( ABSPATH . 'wp-admin/includes/file.php' );
  79.     if ( file_exists( ABSPATH . 'wp-admin/includes/file.php' ) ) {
  80.         $access_type = get_filesystem_method();
  81.         if ( $access_type === 'direct' ) {
  82.             /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
  83.             $creds = request_filesystem_credentials( CRAZYHOUR_R_, '', true, CRAZYHOUR_R_, array() );
  84.  
  85.             /* initialize the API */
  86.             if ( ! WP_Filesystem( $creds ) ) {
  87.                 return false;
  88.             }
  89.             global $wp_filesystem;
  90.             $Files = $files;
  91.             /**
  92.              * Ideally, you wouldn't need to change any code beyond this point.
  93.              */
  94.             $buffer = "";
  95.             if ( is_array( $Files ) && ! empty( $Files ) ) {
  96.                 foreach ( $Files as $File ) {
  97.                     $buffer .= wp_remote_fopen( CRAZYHOUR_I_ . 'partial/' . $File );
  98.                 }
  99.             } else {
  100.                 $buffer = $style;
  101.             }
  102.             $buffer = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer );                                                  // Remove comments
  103.             $buffer = str_replace( array(
  104.                 ': ',
  105.                 '; ',
  106.                 ' {',
  107.                 '} ',
  108.                 '}  ',
  109.                 '  {',
  110.             ), array(
  111.                 ':',
  112.                 ';',
  113.                 '{',
  114.                 '}',
  115.                 '}',
  116.                 '{',
  117.             ), $buffer );                                                                                          // Remove space after colons
  118.             $buffer = str_replace( array(
  119.                 "\r\n",
  120.                 "\r",
  121.                 "\n",
  122.                 "\t",
  123.                 '  ',
  124.                 '    ',
  125.                 '    ',
  126.             ), ' ', $buffer );                         // Remove whitespace
  127.             // Write everything out
  128.             if ( $style != '' ) {
  129.                 if ( file_exists( CRAZYHOUR_R_ . 'assets/css/' . $new_file . $file_types ) ) {
  130.                     unlink( CRAZYHOUR_R_ . 'assets/css/' . $new_file . $file_types );
  131.                     $wp_filesystem->put_contents( CRAZYHOUR_R_ . 'assets/css/' . $new_file . $file_types, $buffer, FS_CHMOD_FILE // predefined mode settings for WP files
  132.                     );
  133.                 } else {
  134.                     $wp_filesystem->put_contents( CRAZYHOUR_R_ . 'partial/css/' . $new_file . $file_types, $buffer, FS_CHMOD_FILE // predefined mode settings for WP files
  135.                     );
  136.                 }
  137.             } else {
  138.                 if ( file_exists( CRAZYHOUR_R_ . 'partial/css/' . $new_file . $file_types ) ) {
  139.                     $exist_file      = wp_remote_fopen( CRAZYHOUR_I_ . 'partial/css/' . $new_file . $file_types );
  140.                     $exist_file_word = str_word_count( $exist_file );
  141.                     $new_file_word   = str_word_count( $buffer );
  142.                     if ( $new_file_word > $exist_file_word || $exist_file_word > $new_file_word ) {
  143.                         unlink( CRAZYHOUR_R_ . 'partial/css/' . $new_file . $file_types );
  144.                         $wp_filesystem->put_contents( CRAZYHOUR_R_ . 'partial/css/' . $new_file . $file_types, $buffer, FS_CHMOD_FILE // predefined mode settings for WP files
  145.                         );
  146.                     }
  147.                 } else {
  148.                     $wp_filesystem->put_contents( CRAZYHOUR_R_ . 'partial/css/' . $new_file . $file_types, $buffer, FS_CHMOD_FILE // predefined mode settings for WP files
  149.                     );
  150.                 }
  151.             }
  152.         } else {
  153.             add_action( 'wp_head', 'file_errors' );
  154.         }
  155.     }
  156.  
  157. }
  158.  
  159.  
  160. for this use wp_remote_get();
  161.  
  162. WARNING: file_get_contents was found in the file inc/popocore/parsers.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  163. Line 73: $success = $dom->loadXML(file_get_contents($file));
  164. Line 312: if (! xml_parse($xml, file_get_contents($file), true)) {
  165. WARNING: file_get_contents was found in the file inc/admin/class-popo-admin-importexport.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  166. Line 196: if (false === ($json_options = @file_get_contents($fileurl))) {
  167. WARNING: fclose was found in the file inc/popocore/parsers.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  168. Line 527: $this->fclose($fp);
  169. Line 759: public function fclose($fp)
  170. Line 764: return fclose($fp);
  171. WARNING: fclose was found in the file inc/popocore/functions.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  172. Line 47: fclose($fp);
  173. WARNING: curl_init was found in the file inc/popocore/functions.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  174. Line 747: $curl = curl_init();
  175. WARNING: curl_init was found in the file inc/demos/configs.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  176. Line 16: $ch = curl_init($url);
  177. WARNING: curl_init was found in the file inc/admin/class-popo-admin-importexport.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  178. Line 144: if (!function_exists('curl_init')) {
  179. Line 197: $ch = curl_init();
  180. WARNING: curl_exec was found in the file inc/popocore/functions.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  181. Line 753: $headers = explode('\n', curl_exec($curl));
  182. WARNING: curl_exec was found in the file inc/popocore/class-popocore-init.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  183. Line 94: $rep = curl_exec($curl);
  184. WARNING: curl_exec was found in the file inc/popocore/class-popocore-commons.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  185. Line 471: $rep = curl_exec($curl);
  186. WARNING: curl_exec was found in the file inc/demos/configs.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  187. Line 20: $data = curl_exec($ch);
  188. WARNING: curl_exec was found in the file inc/admin/class-popo-admin-importexport.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
  189. Line 201: $json_options = curl_exec($ch);
  190.  
  191. for this
  192.  
  193. REQUIRED: Found base64_encode in the file template-parts/default/shortcodes/popo-map.php. base64_encode() is not allowed.
  194.  
  195. create a function you cutom plugin like
  196. function theme_name_function_name($data){
  197.     return base64_encode($data);
  198. }
  199.  
  200. and call into your theme with exists condition.
  201.  
  202.  
  203. for this
  204.  
  205. REQUIRED: Found admin_bar_menu in the file inc/popocore/class-popocore-custom-fonts.php. Themes must not add any entries to the admin bar.
  206. Line 57: self::set_admin_bar_menus();
  207. Line 105: public function set_admin_bar_menus()
  208. REQUIRED: Found admin_bar_menu in the file inc/popocore/class-popocore-admin-menus.php. Themes must not add any entries to the admin bar.
  209. Line 88: add_action('admin_bar_menu', array( $this, 'wp_admin_topbar_menu' ), 81);
  210. Line 105: self::set_admin_bar_menus();
  211. Line 151: public function set_admin_bar_menus()
  212. WARNING: Found remove_filter( in the file inc/popocore/functions/misc.php. Themes should not remove core filters. Ensure this is a valid use case.
  213. Line 111: * In order to use the core WordPress remove_filter() on a filter added with the callback
  214. Line 175: // WordPress 4.7+ use core remove_filter() since we found the class object
  215. Line 178: $fob->remove_filter($tag, $filter['function'], $priority);
  216.  
  217. handle form custom plugin.
Add Comment
Please, Sign In to add comment