src/academic-bloggers-toolkit.php
Showing 176 of 176 total issues
Method register_scripts
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function register_scripts() { // // Editor. // register_script( 'editor-stores' );
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 23 and the first side effect is on line 21. Open
Open
<?php
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( plugin_basename( __FILE__ ) === $file ) {
- Exclude checks
Expected 0 spaces between opening bracket and type hint "array"; 1 found Open
Open
function add_options_link( array $links ): array {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( version_compare( ABT_VERSION, $options['VERSION'] ?? '0', '>' ) ) {
- Exclude checks
Expected 0 spaces between argument "$links" and closing bracket; 1 found Open
Open
function add_options_link( array $links ): array {
- Exclude checks
Expected 0 spaces between opening bracket and type hint "array"; 1 found Open
Open
function add_donate_link( array $links, string $file ): array {
- Exclude checks
Expected 0 spaces between argument "$file" and closing bracket; 1 found Open
Open
function add_donate_link( array $links, string $file ): array {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( is_admin() ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$links[] = sprintf(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$text = __( 'Plugin Settings', 'academic-bloggers-toolkit' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'VERSION' => ABT_VERSION,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
wp_register_script(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'//assets.codepen.io/assets/embed/ei.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'♥ <a href="%s">%s</a>',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'abt-editor-stores',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'SET_CITATION_STYLE' => 'abt-form-set-citation-style',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
delete_option( ABT_OPTIONS_KEY );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'abt-editor-stores',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'abt-editor-formats',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'codepen',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
true
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$new_options = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$url = admin_url( 'options-general.php?page=abt-options' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
require_once __DIR__ . '/php/frontend.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Vendor.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
ABT_VERSION,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
</script>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
require_once __DIR__ . '/php/editor.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
require_once __DIR__ . '/php/options.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'value' => $options['citation_style']['value'] ?? 'american-medical-association',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
update_option( ABT_OPTIONS_KEY, $new_options );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'abt-editor-blocks',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<script type="text/javascript">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( version_compare( ABT_VERSION, $options['VERSION'] ?? '0', '>' ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'kind' => $options['citation_style']['kind'] ?? 'predefined',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'label' => $options['citation_style']['label'] ?? 'American Medical Association',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'https://donorbox.org/academic-bloggers-toolkit',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script( 'options-page' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
load_plugin_textdomain( 'academic-bloggers-toolkit', false, basename( ABT_ROOT_PATH ) . '/languages' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return array_merge( $links, [ "<a href='$url'>$text</a>" ] );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'citeproc',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'ABT_ACTIONS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( plugin_basename( __FILE__ ) === $file ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $links;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'editor-formats',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
wp_register_script(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
ABT_ROOT_URI . '/vendor/citeproc.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Editor.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'editor-blocks',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$options = get_option( ABT_OPTIONS_KEY );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'citation_style' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'abt-editor-stores',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Frontend.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script( 'frontend' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
filemtime( ABT_ROOT_PATH . '/vendor/citeproc.js' ),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script( 'editor-stores' );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Options Page.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
__( 'Donate', 'academic-bloggers-toolkit' )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
register_script(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'editor',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Third party.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
window._abt_nonce = '<?php echo esc_html( wp_create_nonce( 'abt-ajax' ) ); ?>'
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_ROOT_URI', plugins_url( '', __FILE__ ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$text = __( 'Plugin Settings', 'academic-bloggers-toolkit' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( plugin_basename( __FILE__ ) === $file ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_ROOT_URI', plugins_url( '', __FILE__ ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_ROOT_URI', plugins_url( '', __FILE__ ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$text = __( 'Plugin Settings', 'academic-bloggers-toolkit' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\add_options_link' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$options = get_option( ABT_OPTIONS_KEY );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( version_compare( ABT_VERSION, $options['VERSION'] ?? '0', '>' ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'admin_init', __NAMESPACE__ . '\refactor_options' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return array_merge( $links, [ "<a href='$url'>$text</a>" ] );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\add_options_link' );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( plugin_basename( __FILE__ ) === $file ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_textdomain' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( plugin_basename( __FILE__ ) === $file ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
__( 'Donate', 'academic-bloggers-toolkit' )
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_OPTIONS_KEY', 'abt_options' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'wp_loaded', __NAMESPACE__ . '\register_scripts' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'wp_loaded', __NAMESPACE__ . '\register_scripts' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_NONCE', 'abt_nonce' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
load_plugin_textdomain( 'academic-bloggers-toolkit', false, basename( ABT_ROOT_PATH ) . '/languages' );
- Exclude checks
Opening brace should be on a new line Open
Open
function add_options_link( array $links ): array {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_filter( 'plugin_row_meta', __NAMESPACE__ . '\add_donate_link', 10, 2 );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
window._abt_nonce = '<?php echo esc_html( wp_create_nonce( 'abt-ajax' ) ); ?>'
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( is_admin() ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
load_plugin_textdomain( 'academic-bloggers-toolkit', false, basename( ABT_ROOT_PATH ) . '/languages' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
delete_option( ABT_OPTIONS_KEY );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
register_uninstall_hook( __FILE__, __NAMESPACE__ . '\uninstall' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$options = get_option( ABT_OPTIONS_KEY );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
update_option( ABT_OPTIONS_KEY, $new_options );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
register_script( 'editor-stores' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
register_script( 'frontend' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_VERSION', '{{VERSION}}' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_textdomain' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'admin_init', __NAMESPACE__ . '\refactor_options' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
__( 'Donate', 'academic-bloggers-toolkit' )
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'admin_head-settings_page_abt-options', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_NONCE', 'abt_nonce' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\add_options_link' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'admin_head-post.php', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
register_uninstall_hook( __FILE__, __NAMESPACE__ . '\uninstall' );
- Exclude checks
Opening brace should be on a new line Open
Open
function add_donate_link( array $links, string $file ): array {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_filter( 'plugin_row_meta', __NAMESPACE__ . '\add_donate_link', 10, 2 );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
filemtime( ABT_ROOT_PATH . '/vendor/citeproc.js' ),
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_OPTIONS_KEY', 'abt_options' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_ROOT_URI', plugins_url( '', __FILE__ ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
delete_option( ABT_OPTIONS_KEY );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
register_script( 'options-page' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
window._abt_nonce = '<?php echo esc_html( wp_create_nonce( 'abt-ajax' ) ); ?>'
- Exclude checks
Opening brace should be on a new line Open
Open
function plugin_textdomain() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$url = admin_url( 'options-general.php?page=abt-options' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$url = admin_url( 'options-general.php?page=abt-options' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
filemtime( ABT_ROOT_PATH . '/vendor/citeproc.js' ),
- Exclude checks
Opening brace should be on a new line Open
Open
function ajax_nonce() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'admin_head-settings_page_abt-options', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
define( 'ABT_ROOT_PATH', __DIR__ );
- Exclude checks
Opening brace should be on a new line Open
Open
function refactor_options() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return array_merge( $links, [ "<a href='$url'>$text</a>" ] );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_VERSION', '{{VERSION}}' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
load_plugin_textdomain( 'academic-bloggers-toolkit', false, basename( ABT_ROOT_PATH ) . '/languages' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
load_plugin_textdomain( 'academic-bloggers-toolkit', false, basename( ABT_ROOT_PATH ) . '/languages' );
- Exclude checks
Opening brace should be on a new line Open
Open
function uninstall() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
update_option( ABT_OPTIONS_KEY, $new_options );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\add_options_link' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
register_script( 'editor-stores' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
register_script( 'options-page' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'admin_head-post-new.php', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
defined( 'ABSPATH' ) || exit;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
defined( 'ABSPATH' ) || exit;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
define( 'ABT_ROOT_PATH', __DIR__ );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
window._abt_nonce = '<?php echo esc_html( wp_create_nonce( 'abt-ajax' ) ); ?>'
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( version_compare( ABT_VERSION, $options['VERSION'] ?? '0', '>' ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( version_compare( ABT_VERSION, $options['VERSION'] ?? '0', '>' ) ) {
- Exclude checks
Opening brace should be on a new line Open
Open
function register_scripts() {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
window._abt_nonce = '<?php echo esc_html( wp_create_nonce( 'abt-ajax' ) ); ?>'
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
register_script( 'frontend' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
add_action( 'admin_head-post-new.php', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
add_action( 'admin_head-post.php', __NAMESPACE__ . '\ajax_nonce' );
- Exclude checks