10% anti-block

Code Review | Anti-block

WordPress plugin Anti-block scored10%from 54 tests.

About plugin

  • Plugin page: anti-block
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Jan 6, 2014
  • Latest release: Mar 30, 2017
  • Number of updates: 42
  • Update frequency: every 28.1 days
  • Top authors: bukssaayman (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /4,517 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/anti-block/functions.php+16
    Use of undefined constant SETTINGS - assumed 'SETTINGS' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.06ms] Passed 4 tests

An overview of server-side resources used by Anti-block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.34 ▼0.80
Dashboard /wp-admin3.31 ▲0.0046.46 ▼3.21
Posts /wp-admin/edit.php3.36 ▲0.0048.83 ▲3.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.50 ▼0.00
Media Library /wp-admin/upload.php3.23 ▲0.0034.35 ▼0.21

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Anti-block
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.73 ▼0.661.76 ▼0.3344.74 ▼3.93
Dashboard /wp-admin2,203 ▲155.82 ▲0.01100.20 ▼18.1040.78 ▼3.42
Posts /wp-admin/edit.php2,089 ▲31.99 ▼0.0240.30 ▲4.4037.07 ▲5.96
Add New Post /wp-admin/post-new.php1,533 ▲1923.21 ▲5.53607.45 ▼24.6947.44 ▼2.63
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.00104.39 ▲7.6244.25 ▲1.91

Uninstaller [IO: ▲0.02MB] [DB: ▲0.00MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/anti-block/functions.php+16
    Use of undefined constant SETTINGS - assumed 'SETTINGS' (this will throw an Error in a future version of PHP)
  • The plugin did not uninstall successfully, leaving 8 files (0.02MB) in the plugin directory
    • (new file) readme.txt
    • (new file) classes/detection.php
    • (new file) functions.php
    • (new file) popup.php
    • (new file) js/advertisement.js
    • (new file) antiblock.php
    • (new file) classes/settings.php
    • (new file) classes/setup.php
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/anti-block/popup.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/anti-block/popup.php on line 61
    • > PHP Notice
      Undefined variable: no in wp-content/plugins/anti-block/popup.php on line 67
    • > PHP Notice
      Undefined variable: yes in wp-content/plugins/anti-block/popup.php on line 65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/anti-block/classes/settings.php:169
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/anti-block/popup.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/anti-block/functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/anti-block/functions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === anti-block === )
The official readme.txt is a good inspiration

anti-block/antiblock.php 92% from 13 tests

The main PHP script in "Anti-block" version 1.0.6 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("anti-block.php" instead of "antiblock.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected284 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP66763281
JavaScript1203

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.00
▷ Minimum class complexity5.00
▷ Maximum class complexity14.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods420.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin