Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run theme check plugin against 0.6.2 #1677

Closed
benlk opened this issue Apr 22, 2019 · 8 comments
Closed

Run theme check plugin against 0.6.2 #1677

benlk opened this issue Apr 22, 2019 · 8 comments
Assignees
Milestone

Comments

@benlk
Copy link
Collaborator

benlk commented Apr 22, 2019

https://wordpress.org/plugins/theme-check/

After running this plugin, create issues in Largo for the issues identified by that plugin.

This is basically the same as #1460, but for this version of the theme.

This is a specific instance of #844.

@benlk benlk added this to the 0.6.2 milestone Apr 22, 2019
@joshdarby
Copy link
Collaborator

Here's the output for the 0.5-dev branch.

Required:

  • The theme uses the register_taxonomy() function, which is plugin-territory functionality.
  • The theme uses the register_post_type() function, which is plugin-territory functionality.
  • The <title> tags can only contain a call to wp_title(). Use the wp_title filter to modify the output
  • Please remove any extraneous directories like .git or .svn from the ZIP file before uploading it.
  • Found a Customizer setting that did not have a sanitization callback function. Every call to the add_setting() method needs to have a sanitization callback function passed.
  • lib/clean-contact/clean_contact.php. Themes should use add_theme_page() for adding admin pages.
    Line 272: add_submenu_page( 'options-general.php', __( 'Clean Contact', 'largo' ), __
  • inc/update.php. Themes should use add_theme_page() for adding admin pages.
    Line 897: add_submenu_page(
  • get_currentuserinfo() found in the file inc/users.php. Deprecated since version 4.5. Use wp_get_current_user instead.

Warning - Non-translation Related:

  • Your theme appears to be in the wrong directory for the theme name. The directory name must match the slug of the theme. This theme's correct slug and text-domain is project-largo-base-theme.
    (If this is a child theme, you can ignore this error.)
  • The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.
  • Both DOS and UNIX style line endings were found in the file node_modules/less/test/browser/less.js. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
  • Both DOS and UNIX style line endings were found in the file node_modules/less/dist/lessc-rhino-1.7.5.js. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
  • Both DOS and UNIX style line endings were found in the file node_modules/less/dist/less-rhino-1.7.5.js. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
  • Both DOS and UNIX style line endings were found in the file node_modules/less/dist/less-1.7.5.min.js. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
  • Both DOS and UNIX style line endings were found in the file node_modules/less/dist/less-1.7.5.js. This causes a problem with SVN repositories and must be corrected before the theme can be accepted. Please change the file to use only one style of line endings.
  • file_get_contents was found in the file tests/inc/test-post-templates.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
    Line 37: $contents = file_get_contents( $filename );
    Line 68: $contents = file_get_contents( $filename );
    Line 106: $contents = file_get_contents( $filename );
    Line 147: $contents = file_get_contents( $filename );
    Line 188: $contents = file_get_contents( $filename );
    Line 220: $contents = file_get_contents( $filename );
  • file_get_contents was found in the file inc/avatars/admin.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.
    Line 64: @file_get_contents($_FILES[LARGO_AVATAR_INPUT_NAME]['tmp_name'])
  • .ds_store .npmignore .travis.yml .bin .jshintrc .eslintrc .gitkeep .editorconfig .eslintignore .grunt .idea .name .eslintrc.json .gitmodules .jshintignore .dir-locals.el .istanbul.yml .coveralls.yml .readthedocs.yml .gitignore .git Hidden Files or Folders found.

Warning - Translation Related:

  • More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress.org language packs.
    The domains found are largo, options_framework_theme, cf-tax-landing, : Footer, \s Likes on Twitter, twitter_username, name, posts_term_plural, Posts, optionsframework, argo-links
  • Found a translation function that is missing a text-domain. Function _x, with the arguments 'Series', 'taxonomy singular name'
  • Found a translation function that is missing a text-domain. Function _x, with the arguments 'Series', 'taxonomy general name'
  • Found a translation function that is missing a text-domain. Function _x, with the arguments 'Post Prominence', 'taxonomy singular name'
  • Found a translation function that is missing a text-domain. Function _x, with the arguments 'Post Prominence', 'taxonomy general name'
  • Found a translation function that is missing a text-domain. Function _n, with the arguments 'One thought on “%2$s”', '%1$s thoughts on “%2$s”'
  • Found a translation function that is missing a text-domain. Function _n, with the arguments '%s result', '%s results'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'largo'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Title:'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'This version of Largo includes a variety of updates, enhancements and changes.'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'These changes affect'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Theme options'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Site navigation'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Sidebars and widgets'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Include:'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'Configured menus'
  • Found a translation function that is missing a text-domain. Function _e, with the arguments 'CC E-mail address'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'largo'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'When a taxonomy archive is requested, such as a category page, the first Landing Page with that taxonomy (if any) is used.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'View Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'View Post Prominence'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Update Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Update Post Prominence'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Uncategorized'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'To override the default related posts functionality enter specific related post IDs separated by commas.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Sticky navigation overflow'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Specify at least one category, tag, or custom taxonomy.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Select Color'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Search Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Search Post Type'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Search Post Prominences'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Post Prominence'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Parent Series:'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Parent Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Parent Post Prominence:'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Parent Post Prominence'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'New Series Name'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'New Post Prominence Name'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'M j, Y @ G:i'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Hide the featured posts area on category pages?'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Greetings'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Filter messages for SPAM through the'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Edit Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Edit Post Prominence'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Default'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Custom field updated.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Custom field deleted.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Contact Reasons & Recipients'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Clear'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'By default, a floating/sticky navigation bar is visible on all pages for mobile screen sizes. The sticky navigation bar will disappear when a user scrolls down and reappear when a user begins to scroll up. When the main navigation is visible, the sticky navigation will disappear. This feature can be deactivated but we typically recommend sticking with the default behavior.'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Auto-generated by current homepage template'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Alternate site name for sticky navigation'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'All Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'All Post Prominences'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Add New Series'
  • Found a translation function that is missing a text-domain. Function __, with the arguments 'Add New Post Prominence'
  • Found a translation function that has an incorrect number of arguments. Function __, with the arguments 'twitter_username', \s Likes on Twitter, 'largo'
  • Found a translation function that has an incorrect number of arguments. Function __, with the arguments 'Tweets by @', twitter_username, 'largo'
  • Found a translation function that has an incorrect number of arguments. Function __, with the arguments 'Series ', : Footer, 'largo'

Recommended:

  • Screenshot size should be 1200x900, to account for HiDPI displays. Any 4:3 image size is acceptable, but 1200x900 is preferred.
  • Possible variable $widget found in translation function in inc/wp-taxonomy-landing/functions/cftl-admin.php. Translation function calls must NOT contain PHP variables.
    Line 628: 'name' => __( 'Series ' . $widget->post_title . ': Footer', 'largo' ),
  • Possible variable $warning found in translation function in functions.php. Translation function calls must NOT contain PHP variables.
    Line 381: _e( $warning, 'largo' );
  • Possible variable $val found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 908: $rep = $this->compileValue($this->lib_e($val));
  • Possible variable $title found in translation function in inc/metabox-api.php. Translation function calls must NOT contain PHP variables.
    Line 40: 'title' => __( $title, 'largo'),
  • Possible variable $this found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 1294: return $this->lib_e($this->reduce($inner));
  • Possible variable $string found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 894: $template = $this->compileValue($this->lib_e($string));
  • Possible variable $str found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 133: $url = $this->compileValue($this->lib_e($str));
  • Possible variable $sidebar found in translation function in inc/sidebars.php. Translation function calls must NOT contain PHP variables.
    Line 108: 'name' => __( $sidebar, 'largo' ),
  • Possible variable $res found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 1256: if (empty($value[2])) $res = $this->lib_e($res);
  • Possible variable $part found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 1288: if ($strip) $part = $this->lib_e($part);
  • Possible variable $newUnit found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 937: $this->compileValue($this->lib_e($newUnit)));
  • Possible variable $language found in translation function in inc/featured-media.php. Translation function calls must NOT contain PHP variables.
    Line 471: echo '<a href='#' id='set-featured-media-button' class='button set-featured-media add_media' data-editor='content' title='' . __( $language . ' Featured Media', 'largo' ) . ''> ' . __( $language
  • Possible variable $key found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 1263: $key = $this->vPrefix . $this->compileValue($this->lib_e($key));
  • Possible variable $items found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 877: return $this->lib_e($items[0]);
  • Possible variable $instance found in translation function in inc/widgets/largo-twitter.php. Translation function calls must NOT contain PHP variables.
    Line 50: $widget_text = __( 'Tweets by @' . $instance['twitter_username'], 'largo' );
  • Possible variable $instance found in translation function in inc/widgets/largo-twitter.php. Translation function calls must NOT contain PHP variables.
    Line 33: $widget_text = __( $instance['twitter_username'] . ''s Likes on Twitter', 'largo' );
  • Possible variable $arg found in translation function in lib/lessc.inc.php. Translation function calls must NOT contain PHP variables.
    Line 872: protected function lib_e($arg) {
  • No reference to add_theme_support( "custom-header", $args ) was found in the theme. It is recommended that the theme implement this functionality if using an image for the header.
  • No reference to add_theme_support( "custom-background", $args ) was found in the theme. If the theme uses background images or solid colors for the background, then it is recommended that the theme implement this functionality.
  • Tags: is either empty or missing in style.css header.

Info:

  • Possible hard-coded links were found in the file options.php.
    Line 270: 'desc' => __('Information about these options can be found in <a href='https://largo.readthedocs.io/users/prelaunchchecklist.html'>the pre-launch
    Line 627: 'desc' => __('Google Custom Search typically returns better results than the search engine built into WordPress. You can get your ID and configure it at <a href='https://www.google.com/cse/create/new'>https://www.google.com/cse/create/ne
  • Possible hard-coded links were found in the file inc/dashboard.php.
    Line 73: <li><a href='https://largo.inn.org/'>Largo Project Website</a></li>
    Line 120: $args = array( 'id' => 'website', 'title' => 'Main Website', 'href' => 'https://largo.inn.org//', 'parent' => 'largo_admin_mega' );
    Line 163: return '<span id='footer-thankyou'>This website powered by <a href='https://largo.inn.org/'>Project Largo</a> from <a href='https://inn.org/'>I
    Line 74: <li><a href='https://largo.readthedocs.io/'>Largo Documentation</a></li>
    Line 124: $args = array( 'id' => 'largo_docs', 'title' => 'Documentation', 'href' => 'https://largo.readthedocs.io/', 'parent' => 'largo_admin_mega' );
    Line 76: <li><a href='https://support.inn.org/'>Help Desk</a></li>
    Line 77: <li><a href='https://support.inn.org/'>Knowledge Base</a></li>
    Line 128: $args = array( 'id' => 'knowledge_base', 'title' => 'Knowledge Base', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 132: $args = array( 'id' => 'support', 'title' => 'Help Desk', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 136: $args = array( 'id' => 'user_forums', 'title' => 'Community Forums', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 76: <li><a href='https://support.inn.org/'>Help Desk</a></li>
    Line 77: <li><a href='https://support.inn.org/'>Knowledge Base</a></li>
    Line 128: $args = array( 'id' => 'knowledge_base', 'title' => 'Knowledge Base', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 132: $args = array( 'id' => 'support', 'title' => 'Help Desk', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 136: $args = array( 'id' => 'user_forums', 'title' => 'Community Forums', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' );
    Line 79:

    Developers can also log issues on <a href='https://github.com/INN/Largo'>our public github repository</a> and if you w
    Line 140: https://github.com/inn/largo', 'parent' => 'largo_admin_mega' );
    Line 73: <li><a href='https://largo.inn.org/'>Largo Project Website</a></li>
    Line 120: $args = array( 'id' => 'website', 'title' => 'Main Website', 'href' => 'https://largo.inn.org//', 'parent' => 'largo_admin_mega' );
    Line 163: return 'This website powered by <a href='https://largo.inn.org/'>Project Largo</a> from <a href='https://inn.org/'>I

  • Possible hard-coded links were found in the file inc/custom-less-variables.php.
    Line 453:
    Line 539: <a href='themes.php?page=largo_custom_less_variables'><?php echo mysql2date( 'j F, Y
    Line 549: <a href='themes.php?page=largo_custom_less_variables&amp;revision=<?php echo esc_att
  • Possible hard-coded links were found in the file inc/avatars/admin.php.
    Line 43: _e('Currently using Gravatar. Change at <a href='https://gravatar.com/'>gravatar.com</a> or choose a different image below.'
  • tests/mock/mock-options-framework.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 16: include_once(ABSPATH . 'wp-admin/includes/screen.php');
    Line 17: include_once(dirname(dirname(DIR)) . '/options.php');
  • tests/inc/test-enqueue.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 42: require( ABSPATH . WPINC . '/version.php' );
  • lib/options-framework/options-framework.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 66: require_once($optionsfile);
  • lib/lessc.inc.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 77: require_once(ABSPATH . 'wp-admin/includes/file.php');
    Line 93: require_once(ABSPATH . 'wp-admin/includes/file.php');
  • lib/clean-contact/clean_contact.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 283: include(dirname(FILE).'/clean_contact_conf.php');
    Line 296: require_once(ABSPATH . 'wp-admin/includes/file.php');
  • largo-apis.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 5: * require_once( get_template_directory() . '/largo-apis.php' );
    Line 19: include_once( get_template_directory() . $include );
  • js/tinymce/plugins/largo/window.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 3: require( '../../../../../../../wp-load.php' ); // we're a long way from hom
  • inc/wp-taxonomy-landing/taxonomy-landing.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 37: include('functions/cftl-admin.php');
    Line 38: include('functions/cftl-intercept-queries.php');
    Line 39: include('functions/cftl-series-order.php');
  • inc/widgets.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 50: require_once( get_template_directory() . $val );
  • inc/update.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 29: require_once( get_template_directory() . $required );
  • inc/term-icons.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 16: require_once(ABSPATH . 'wp-admin/includes/file.php');
  • inc/featured-media.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 622: require_once( ABSPATH . WPINC . '/class-oembed.php' );
  • inc/custom-less-variables.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 135: require_once(ABSPATH . 'wp-admin/includes/file.php');
    Line 151: require_once(ABSPATH . 'wp-admin/includes/file.php');
    Line 239: require( dirname( FILE ) . '/../lib/lessc.inc.php' );
  • inc/avatars/admin.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 80: require_once( ABSPATH . 'wp-admin/includes/image.php' );
  • iframe was found in the file tests/inc/test-featured-media.php iframes are sometimes used to load unwanted adverts and code on your site.
    Line 29: 'embed' => '<iframe id='test-iframe-embed-code'></iframe>',
    Line 38: 'embed' => '<iframe id='test-iframe-embed-code'></iframe>',
  • iframe was found in the file inc/helpers.php iframes are sometimes used to load unwanted adverts and code on your site.
    Line 173: * For a given YouTube URL, return an iframe to embed
    Line 177: * @return string a standard YouTube iframe embed code
    Line 181: function largo_youtube_iframe_from_url( $url, $echo = TRUE ) {
    Line 182: $output = '<iframe src='//www.youtube.com/embed/' . largo_youtube_url_to_ID( $url ) .
  • homepages/homepage-class.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
    Line 5: require_once( ABSPATH . 'wp-admin/includes/file.php' );

@benlk
Copy link
Collaborator Author

benlk commented Apr 24, 2019

For the Required items:

  • The theme uses the register_taxonomy() function, which is plugin-territory functionality.
  • The theme uses the register_post_type() function, which is plugin-territory functionality.

Won't fix these until we can pull all the Largo plugin functionality out into a separate plugin.

The <title> tags can only contain a call to wp_title(). Use the wp_title filter to modify the output

This is probably alarming over a fallback:
https://github.com/INN/largo/blob/71aa7398e9647d1d1192a185dc3ac512d3d97b2b/header.php#L21-L31

Please remove any extraneous directories like .git or .svn from the ZIP file before uploading it.

Can be ignored.

Found a Customizer setting that did not have a sanitization callback function. Every call to the add_setting() method needs to have a sanitization callback function passed.

This is an issue.

lib/clean-contact/clean_contact.php. Themes should use add_theme_page() for adding admin pages.
Line 272: add_submenu_page( 'options-general.php', __( 'Clean Contact', 'largo' ), __

Please create an issue for removing the Clean Contact library, and assign it to 0.7

inc/update.php. Themes should use add_theme_page() for adding admin pages.
Line 897: add_submenu_page(

I'm not worried about this; but we should address it eventually.

get_currentuserinfo() found in the file inc/users.php. Deprecated since version 4.5. Use wp_get_current_user instead.

Not a problem; this is a fallback:

https://github.com/INN/largo/blob/b6068fe5b4189503c3d1cf5f1d7b7e76385b1e59/inc/users.php#L137-L141

@joshdarby
Copy link
Collaborator

@benlk in regards to...

Found a Customizer setting that did not have a sanitization callback function. Every call to the add_setting() method needs to have a sanitization callback function passed.

That can be traced to here https://github.com/INN/largo/blob/71aa7398e9647d1d1192a185dc3ac512d3d97b2b/inc/customizer/customizer.php#L119

@benlk
Copy link
Collaborator Author

benlk commented Apr 24, 2019

So it looks like we are passing sanitization callback in the $options parameter, from lines higher on that page.

https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_setting

@joshdarby
Copy link
Collaborator

@benlk Strange. I modified the theme-check plugin checks/customizer.php customizer class and added echo "$file_path : $match "; on error so it would show where the error is coming from and that line is what it returned.

@benlk
Copy link
Collaborator Author

benlk commented Apr 24, 2019

https://github.com/INN/largo/blob/71aa7398e9647d1d1192a185dc3ac512d3d97b2b/inc/customizer/customizer.php#L85-L120

Does the theme check plugin do static analysis? My thought here is that it's looking for the definition of $options but not finding any definition that includes sanitize_callback, because it's not parsing foreach ( $settings as $setting => $option ) to get the array of options arrays, which each contain a sanitize_callback mention.

@joshdarby
Copy link
Collaborator

joshdarby commented Apr 24, 2019

@benlk You're onto something. They're only checking that sanitize_callback as a string is present in the match from preg_match_all( '/\$wp_customize->add_setting\(([^;]+)/', $file_content, $matches )

if ( false === strpos( $match, 'sanitize_callback' ) && false === strpos( $match, 'sanitize_js_callback' ) ) {```

@benlk
Copy link
Collaborator Author

benlk commented Apr 24, 2019

Then I think we're fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants