84% tiny-simple-adblock-detector

Code Review | Tiny Simple AdBlock Detector

WordPress plugin Tiny Simple AdBlock Detector scored84%from 54 tests.

About plugin

  • Plugin page: tiny-simple-adblo...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 5, 2016
  • Latest release: Nov 23, 2022
  • Number of updates: 7
  • Update frequency: every 333.7 days
  • Top authors: MythThrazz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /963 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

An overview of server-side resources used by Tiny Simple AdBlock Detector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.48 ▼2.03
Dashboard /wp-admin3.32 ▲0.0143.91 ▼4.06
Posts /wp-admin/edit.php3.37 ▲0.0146.38 ▼0.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.84 ▼13.16
Media Library /wp-admin/upload.php3.24 ▲0.0134.39 ▲0.60

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Tiny Simple AdBlock Detector
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.29 ▼1.095.13 ▲3.2739.38 ▼6.96
Dashboard /wp-admin2,222 ▲375.88 ▲1.02108.08 ▲5.3639.07 ▼1.97
Posts /wp-admin/edit.php2,108 ▲162.06 ▲0.0539.48 ▲2.7335.06 ▼3.71
Add New Post /wp-admin/post-new.php1,546 ▲2723.27 ▲0.14629.48 ▼32.0462.28 ▲2.78
Media Library /wp-admin/upload.php1,401 ▲164.17 ▼0.0997.37 ▼7.7842.77 ▼4.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tiny-simple-adblock-detector/tiny-simple-adblock-detector.php:176

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === tiny-simple-adblock-detector === )
Please take inspiration from this readme.txt

tiny-simple-adblock-detector/tiny-simple-adblock-detector.php Passed 13 tests

The primary PHP file in "Tiny Simple AdBlock Detector" version 1.1.0 is used by WordPress to initiate all plugin functionality
92 characters long description:
Detects (some) AdBlocking software and allows to display some html based on detection result

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected204 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP12719130
JavaScript371640
PO File15534

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
ad-banner-example_x28.png9.18KB2.33KB▼ 74.66%