83% simple-adblock-detector

Code Review | Simple AdBlock Detector

WordPress plugin Simple AdBlock Detector scored83%from 54 tests.

About plugin

  • Plugin page: simple-adblock-de...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 6.3.1
  • First release: Aug 18, 2020
  • Latest release: Aug 18, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: ajarouih (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /613 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.01ms] Passed 4 tests

Analyzing server-side resources used by Simple AdBlock Detector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.80 ▲5.68
Dashboard /wp-admin3.31 ▲0.0147.77 ▼14.17
Posts /wp-admin/edit.php3.36 ▲0.0148.80 ▼0.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.59 ▼6.52
Media Library /wp-admin/upload.php3.24 ▲0.0136.29 ▼2.68

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 10 new options
New WordPress options
sad_post_animation
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
sad_post_devtools
widget_recent-comments
sad_post_title
widget_theysaidso_widget
sad_post_description

Browser metrics Passed 4 tests

A check of browser resources used by Simple AdBlock Detector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7914.62 ▲0.462.34 ▲0.4740.75 ▲0.24
Dashboard /wp-admin2,210 ▲305.61 ▼0.0691.98 ▲2.2581.33 ▲40.28
Posts /wp-admin/edit.php2,121 ▲211.97 ▼0.0239.18 ▲0.8233.61 ▼4.27
Add New Post /wp-admin/post-new.php1,539 ▲1323.48 ▲0.28737.68 ▲37.8361.49 ▲8.28
Media Library /wp-admin/upload.php1,409 ▲94.12 ▼0.09100.47 ▼6.3275.14 ▲27.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • sad_post_title
    • sad_post_devtools
    • widget_theysaidso_widget
    • widget_recent-posts
    • sad_post_description
    • sad_post_animation
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-adblock-detector/sad_options.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-adblock-detector/sad_options.php:21

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: adblock detectors, adblock, detect adblock plus

simple-adblock-detector/index.php 77% from 13 tests

The entry point to "Simple AdBlock Detector" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-adblock-detector.php" instead of "index.php")
  • Description: The description should be shorter than 140 characters (currently 142 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin113 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP43536109
CSS3063
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.52MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ico.png2.90KB1.80KB▼ 37.81%
img/sad.png14.29KB5.75KB▼ 59.79%
img/img.png4.95KB2.64KB▼ 46.63%
img/icon-SAD.png8.70KB3.58KB▼ 58.89%
img/sadback.png149.83KB61.44KB▼ 59.00%