89% analytics-spam-blocker

Code Review | Analytics Spam Blocker

WordPress plugin Analytics Spam Blocker scored89%from 54 tests.

About plugin

  • Plugin page: analytics-spam-bl...
  • Plugin version: 3.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Apr 19, 2015
  • Latest release: Apr 18, 2023
  • Number of updates: 77
  • Update frequency: every 38.0 days
  • Top authors: adegans (54.55%)Luke Williamson (46.75%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /36,714 total downloads


Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.88ms] 75% from 4 tests

Server-side resources used by Analytics Spam Blocker
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,001.02ms on /wp-admin/tools.php?page=analytics-spam-blocker)
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1145.82 ▲6.36
Dashboard /wp-admin3.42 ▲0.1254.23 ▼3.87
Posts /wp-admin/edit.php3.54 ▲0.1850.72 ▼0.01
Add New Post /wp-admin/post-new.php6.00 ▲0.1289.01 ▼6.47
Media Library /wp-admin/upload.php3.35 ▲0.1239.42 ▲2.83
Analytics Spam Blocker /wp-admin/tools.php?page=analytics-spam-blocker4.592,001.02

Server storage [IO: ▲0.12MB] [DB: ▲0.10MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • You have illegally modified 1 file (13.92KB) outside of "wp-content/plugins/analytics-spam-blocker/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 16 new files
Database: no new tables, 13 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Analytics Spam Blocker
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.24 ▼0.341.66 ▲0.1042.36 ▲1.81
Dashboard /wp-admin2,192 ▲155.62 ▲0.0590.19 ▼2.2343.83 ▲4.47
Posts /wp-admin/edit.php2,106 ▲62.02 ▼0.0138.13 ▼0.7338.38 ▲0.39
Add New Post /wp-admin/post-new.php1,533 ▲523.43 ▲0.36705.32 ▲47.7951.61 ▲6.98
Media Library /wp-admin/upload.php1,406 ▲64.19 ▲0.02108.26 ▲7.3446.89 ▲0.06
Analytics Spam Blocker /wp-admin/tools.php?page=analytics-spam-blocker1,2001.6724.5964.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • ajdg_spamblocker_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

analytics-spam-blocker/analytics-spam-blocker.php 92% from 13 tests

Analyzing the main PHP file in "Analytics Spam Blocker" version 3.1.2
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin518 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions21100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon-report.png7.53KB3.13KB▼ 58.41%
images/notification.png6.04KB2.66KB▼ 55.99%
images/birthday.png4.24KB2.05KB▼ 51.49%