Missing class import via use statement (line '37', column '7'). Open
new Gitium_Help( $submenu_hook, 'settings' );
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid excessively long variable names like $submit_regenerate_pub_key. Keep variable name length under 20. Open
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Gitium_Submenu_Settings extends Gitium_Menu {
- Exclude checks
The class Gitium_Submenu_Settings is not named in CamelCase. Open
class Gitium_Submenu_Settings extends Gitium_Menu {
public function __construct() {
parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug );
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Method name "Gitium_Submenu_Settings::admin_menu" is not in camel caps format Open
public function admin_menu() {
- Exclude checks
Method name "Gitium_Submenu_Settings::regenerate_webhook" is not in camel caps format Open
public function regenerate_webhook() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $gitium_regen_webhook ) ) {
- Exclude checks
Method name "Gitium_Submenu_Settings::show_webhook_table_webhook_url" is not in camel caps format Open
private function show_webhook_table_webhook_url() {
- Exclude checks
Method name "Gitium_Submenu_Settings::show_webhook_table" is not in camel caps format Open
public function show_webhook_table() {
- Exclude checks
Method name "Gitium_Submenu_Settings::show_webhook_table_public_key" is not in camel caps format Open
private function show_webhook_table_public_key() {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
- Exclude checks
Opening brace of a class must be on the line after the definition Open
class Gitium_Submenu_Settings extends Gitium_Menu {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $submit_regenerate_pub_key ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Method name "Gitium_Submenu_Settings::regenerate_public_key" is not in camel caps format Open
public function regenerate_public_key() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( $this->git->set_gitignore( $gitignore_content ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th><label for="webhook-url"><?php _e( 'Webhook URL', 'gitium' ); ?>:</label></th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<div class="wrap">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<tr>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
gitium_commit_and_push_gitignore_file();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->submenu_slug,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 195 characters Open
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->menu_slug,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Settings',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<td>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</table>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$submenu_hook = add_submenu_page(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<tr>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<td>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p><code id="webhook-url"><?php echo esc_url( gitium_get_webhook() ); ?></code>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</td>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php endif; ?>
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
<input type="submit" name="GitiumSubmitRegeneratePublicKey" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<input type="submit" name="GitiumSubmitRegeneratePublicKey" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function show_webhook_table() {
- Exclude checks
Line exceeds 120 characters; contains 378 characters Open
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<form action="" method="POST">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php endif;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function save() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
<input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</form>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
add_action( 'admin_init', array( $this, 'save' ) );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function admin_menu() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function regenerate_webhook() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
gitium_get_webhook_key( true );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
<p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function show_webhook_table_public_key() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</td>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->show_message();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function regenerate_public_key() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<h2><?php _e( 'Gitium Settings', 'gitium' ); ?></h2>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
GITIUM_MANAGE_OPTIONS_CAPABILITY,
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
<a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p><input type="text" class="regular-text" name="public_key" id="public-key" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function page() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
?>
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
<p><input type="text" class="regular-text" name="public_key" id="public-key" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php $this->show_webhook_table(); ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p class="submit">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
new Gitium_Help( $submenu_hook, 'settings' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
gitium_get_keypair( true );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</tr>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php $this->show_webhook_table_public_key(); ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</div>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
add_action( 'admin_init', array( $this, 'regenerate_webhook' ) );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( ! isset( $submit_regenerate_pub_key ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function show_webhook_table_webhook_url() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
list( $git_public_key, ) = gitium_get_keypair();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php $this->show_webhook_table_webhook_url() ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p><span style="color:red;"><?php _e( 'Be careful when you modify this list!', 'gitium' ); ?></span></p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
add_action( 'admin_init', array( $this, 'regenerate_public_key' ) );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
__( 'Settings' ),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
array( $this, 'page' )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( ! isset( $gitium_regen_webhook ) ) {
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</tr>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<table class="form-table">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php wp_nonce_field( 'gitium-settings' ) ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<textarea name="gitignore_content" rows="20" cols="140"><?php echo esc_html( $this->git->get_gitignore() ); ?></textarea>
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
<textarea name="gitignore_content" rows="20" cols="140"><?php echo esc_html( $this->git->get_gitignore() ); ?></textarea>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( $this->git->set_gitignore( $gitignore_content ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<input type="submit" name="GitiumSubmitSave" class="button-primary" value="<?php _e( 'Save', 'gitium' ); ?>" />
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
new Gitium_Help( $submenu_hook, 'settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( ! isset( $gitium_regen_webhook ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<th><label for="webhook-url"><?php _e( 'Webhook URL', 'gitium' ); ?>:</label></th>
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 14 Open
<?php endif; ?>
- Exclude checks
Opening brace should be on a new line Open
private function show_webhook_table_public_key() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 14 Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
- Exclude checks
Opening brace should be on a new line Open
public function admin_menu() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( $this->git->set_gitignore( $gitignore_content ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<h2><?php _e( 'Gitium Settings', 'gitium' ); ?></h2>
- Exclude checks
Opening brace should be on a new line Open
public function __construct() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $submit_regenerate_pub_key ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
gitium_get_keypair( true );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<p><code id="webhook-url"><?php echo esc_url( gitium_get_webhook() ); ?></code>
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Opening brace should be on a new line Open
public function save() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Class name "Gitium_Submenu_Settings" is not in camel caps format Open
class Gitium_Submenu_Settings extends Gitium_Menu {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
add_action( 'admin_init', array( $this, 'regenerate_webhook' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" />
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<input type="submit" name="GitiumSubmitRegeneratePublicKey" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /></p>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<input type="submit" name="GitiumSubmitSave" class="button-primary" value="<?php _e( 'Save', 'gitium' ); ?>" />
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( $this->git->set_gitignore( $gitignore_content ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
add_action( 'admin_init', array( $this, 'regenerate_public_key' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
__( 'Settings' ),
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $gitium_regen_webhook ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<input type="submit" name="GitiumSubmitRegeneratePublicKey" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /></p>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<textarea name="gitignore_content" rows="20" cols="140"><?php echo esc_html( $this->git->get_gitignore() ); ?></textarea>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
add_action( 'admin_init', array( $this, 'regenerate_public_key' ) );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ! isset( $gitium_regen_webhook ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( ! isset( $submit_regenerate_pub_key ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
add_action( 'admin_init', array( $this, 'save' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
add_action( 'admin_init', array( $this, 'regenerate_webhook' ) );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ! isset( $submit_regenerate_pub_key ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<p><input type="text" class="regular-text" name="public_key" id="public-key" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
- Exclude checks
Opening brace should be on a new line Open
public function show_webhook_table() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
__( 'Settings' ),
- Exclude checks
Opening brace should be on a new line Open
public function regenerate_webhook() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<p><input type="text" class="regular-text" name="public_key" id="public-key" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<?php wp_nonce_field( 'gitium-settings' ) ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<textarea name="gitignore_content" rows="20" cols="140"><?php echo esc_html( $this->git->get_gitignore() ); ?></textarea>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
add_action( 'admin_init', array( $this, 'save' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
gitium_get_webhook_key( true );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
gitium_get_webhook_key( true );
- Exclude checks
Opening brace should be on a new line Open
public function regenerate_public_key() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
gitium_get_keypair( true );
- Exclude checks
Opening brace should be on a new line Open
private function show_webhook_table_webhook_url() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<p><code id="webhook-url"><?php echo esc_url( gitium_get_webhook() ); ?></code>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" />
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
new Gitium_Help( $submenu_hook, 'settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<input type="submit" name="GitiumSubmitSave" class="button-primary" value="<?php _e( 'Save', 'gitium' ); ?>" />
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<?php wp_nonce_field( 'gitium-settings' ) ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<p><span style="color:red;"><?php _e( 'Be careful when you modify this list!', 'gitium' ); ?></span></p>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
check_admin_referer( 'gitium-settings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<th><label for="webhook-url"><?php _e( 'Webhook URL', 'gitium' ); ?>:</label></th>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p>
- Exclude checks
Opening brace should be on a new line Open
public function page() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<h2><?php _e( 'Gitium Settings', 'gitium' ); ?></h2>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<p><span style="color:red;"><?php _e( 'Be careful when you modify this list!', 'gitium' ); ?></span></p>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( $this->git->set_gitignore( $gitignore_content ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
- Exclude checks
The variable $submit_save is not named in camelCase. Open
public function save() {
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
return;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gitium_regen_webhook is not named in camelCase. Open
public function regenerate_webhook() {
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $gitium_regen_webhook ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $git_public_key is not named in camelCase. Open
private function show_webhook_table_public_key() {
list( $git_public_key, ) = gitium_get_keypair();
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
<tr>
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gitignore_content is not named in camelCase. Open
public function save() {
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
return;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gitignore_content is not named in camelCase. Open
public function save() {
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
return;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $submenu_hook is not named in camelCase. Open
public function admin_menu() {
$submenu_hook = add_submenu_page(
$this->menu_slug,
'Settings',
__( 'Settings' ),
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $git_public_key is not named in camelCase. Open
private function show_webhook_table_public_key() {
list( $git_public_key, ) = gitium_get_keypair();
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
<tr>
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $submenu_hook is not named in camelCase. Open
public function admin_menu() {
$submenu_hook = add_submenu_page(
$this->menu_slug,
'Settings',
__( 'Settings' ),
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gitium_regen_webhook is not named in camelCase. Open
public function regenerate_webhook() {
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $gitium_regen_webhook ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $gitignore_content is not named in camelCase. Open
public function save() {
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
return;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $submit_regenerate_pub_key is not named in camelCase. Open
public function regenerate_public_key() {
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_regenerate_pub_key ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $submit_regenerate_pub_key is not named in camelCase. Open
public function regenerate_public_key() {
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_regenerate_pub_key ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $submit_save is not named in camelCase. Open
public function save() {
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
return;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method admin_menu is not named in camelCase. Open
public function admin_menu() {
$submenu_hook = add_submenu_page(
$this->menu_slug,
'Settings',
__( 'Settings' ),
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method regenerate_webhook is not named in camelCase. Open
public function regenerate_webhook() {
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $gitium_regen_webhook ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method regenerate_public_key is not named in camelCase. Open
public function regenerate_public_key() {
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
if ( ! isset( $submit_regenerate_pub_key ) ) {
return;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method show_webhook_table_public_key is not named in camelCase. Open
private function show_webhook_table_public_key() {
list( $git_public_key, ) = gitium_get_keypair();
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
<tr>
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method show_webhook_table_webhook_url is not named in camelCase. Open
private function show_webhook_table_webhook_url() {
?>
<tr>
<th><label for="webhook-url"><?php _e( 'Webhook URL', 'gitium' ); ?>:</label></th>
<td>
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method show_webhook_table is not named in camelCase. Open
public function show_webhook_table() {
?>
<table class="form-table">
<?php $this->show_webhook_table_webhook_url() ?>
<?php $this->show_webhook_table_public_key(); ?>
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}