83% chp-ads-block-detector

Code Review | CHP Ads Block Detector

WordPress plugin CHP Ads Block Detector scored83%from 54 tests.

About plugin

  • Plugin page: chp-ads-block-det...
  • Plugin version: 3.9.8
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Mar 11, 2021
  • Latest release: Jun 15, 2023
  • Number of updates: 48
  • Update frequency: every 17.3 days
  • Top authors: sureshchand12a (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

3,000+ active /68,657 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.23MB] [CPU: ▲1.19ms] Passed 4 tests

An overview of server-side resources used by CHP Ads Block Detector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4246.08 ▲5.53
Dashboard /wp-admin3.57 ▲0.2648.73 ▼1.42
Posts /wp-admin/edit.php3.62 ▲0.2650.20 ▲6.07
Add New Post /wp-admin/post-new.php6.10 ▲0.2286.45 ▼1.25
Media Library /wp-admin/upload.php3.43 ▲0.2035.47 ▲1.91

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for CHP Ads Block Detector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲22814.70 ▲0.4547.02 ▲45.2036.77 ▼6.63
Dashboard /wp-admin2,242 ▲545.17 ▲0.27113.98 ▲0.4640.73 ▼3.19
Posts /wp-admin/edit.php2,127 ▲382.28 ▲0.2640.95 ▲4.4535.11 ▲2.14
Add New Post /wp-admin/post-new.php1,547 ▲1423.51 ▲0.15682.72 ▲36.3836.77 ▼20.87
Media Library /wp-admin/upload.php1,424 ▲364.43 ▲0.2597.26 ▼3.8342.47 ▼6.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • chpadb_plugin_settings
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 take a closer look at the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant CHP_ADSB_URL - assumed 'CHP_ADSB_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/chp-ads-block-detector/view/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/chp-ads-block-detector/view/footer_part.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/chp-ads-block-detector/view/header_part.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/chp-ads-block-detector/view/main_scripts.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/chp-ads-block-detector/view/settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #10, #7, #8, #9 in chp-ads-block-detector/assets to your readme.txt
  • Screenshots: Screenshot #1 (Customizable settings on admin dashboard) image missing
The official readme.txt might help

chp-ads-block-detector/chp-adsblocker-detector.php 77% from 13 tests

"CHP Ads Block Detector" version 3.9.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 272 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("chp-ads-block-detector.php" instead of "chp-adsblocker-detector.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,899 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP224687022,039
CSS244263
JavaScript25098262
Markdown1570178
PO File14445114
JSON20030
SVG20013

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.27
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods84
▷ Static methods1922.62%
▷ Public methods7083.33%
▷ Protected methods00.00%
▷ Private methods1416.67%
Functions11
▷ Named functions545.45%
▷ Anonymous functions654.55%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon_high.png30.94KB12.73KB▼ 58.87%
assets/img/banner.png8.46KB6.59KB▼ 22.10%
assets/img/icon.png15.30KB12.57KB▼ 17.87%