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

Plugin Territory Functions #81

Merged
merged 2 commits into from Oct 13, 2016
Merged

Plugin Territory Functions #81

merged 2 commits into from Oct 13, 2016

Conversation

khacoder
Copy link
Contributor

Initial PR
Issue #73

*/
public function getGroups() {
return array(
'filefunctions' => array(
Copy link
Member

@grappler grappler Sep 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this plugin-territory

@grappler grappler force-pushed the feature/theme-review-sniffs branch 2 times, most recently from 563cd1d to 6671823 Compare September 27, 2016 12:28
* @package PHP_CodeSniffer
* @author khacoder
*/
class WordPress_Sniffs_Theme_PluginTerritoryFunctionsSniff extends WordPress_Sniffs_Functions_FunctionRestrictionsSniff {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should extend the abstract function restrictions sniff

* @category PHP
* @package PHP_CodeSniffer
* @link https://make.wordpress.org/core/handbook/best-practices/coding-standards/
*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before: please update and the same goes for the other docblocks.

Initial commit.
Issue #73
@grappler
Copy link
Member

@jrfnl The checks are passing on this too.

/**
* Restricts the use of various functions that are plugin territory.
*
* @link https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#regular-expressions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the link to a relevant URL in the theme review handbook

return array(
'plugin-territory' => array(
'type' => 'error',
'message' => '%s() is not allowed because it is a plugin territory function.',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if this would read better - feel free to disregard if you don't agree:
Function %s() is not allowed because it is plugin territory

register_taxonomy_for_object_type( 'category', 'page' );
flush_rewrite_rules( false );

xyz_add_shortcode(); // OK.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add these too ?

My_Plugin_Class::add_shortcode();
$my_plugin_object->add_shortcode();

@grappler
Copy link
Member

Requested changes added.

@grappler grappler self-assigned this Oct 13, 2016
* @package PHP_CodeSniffer
* @author khacoder
* @package WPCS\WordPressCodingStandards
* @since 0.10.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 0.xx.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg, in my copy and paste I missed that. Has been fixed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happens to the best of us ;-)

@jrfnl jrfnl merged commit 0385b9a into WPTT:feature/theme-review-sniffs Oct 13, 2016
@jrfnl jrfnl added this to the 0.1.0 milestone Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants