10% wasp-anti-spam

Code Review | WASP - Anti Spam

WordPress plugin WASP - Anti Spam scored10%from 54 tests.

About plugin

  • Plugin page: wasp-anti-spam
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2014
  • Latest release: Dec 25, 2014
  • Number of updates: 15
  • Update frequency: every 21.7 days
  • Top authors: yehudah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,084 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wasp-anti-spam/inc/admin-page-class/admin-page-class.php+277
    Undefined index: top

Server metrics [RAM: ▼0.87MB] [CPU: ▼45.14ms] Passed 4 tests

This is a short check of server-side resources used by WASP - Anti Spam
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7742.74 ▼2.20
Dashboard /wp-admin3.07 ▼0.2310.92 ▼34.57
Posts /wp-admin/edit.php3.08 ▼0.2812.21 ▼38.95
Add New Post /wp-admin/post-new.php3.07 ▼2.8210.42 ▼86.25
Media Library /wp-admin/upload.php3.07 ▼0.1614.23 ▼20.80
WASP Anti-Spam /wp-admin/admin.php?page=ebk_page3.0810.25

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WASP - Anti Spam
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,011 ▲26513.80 ▼0.825.86 ▲4.0529.19 ▼12.57
Dashboard /wp-admin2,231 ▲465.92 ▲0.12106.91 ▲0.9740.31 ▲0.77
Posts /wp-admin/edit.php2,116 ▲242.06 ▲0.0741.13 ▼1.7436.13 ▼1.20
Add New Post /wp-admin/post-new.php1,413 ▼10118.00 ▲0.38626.87 ▼57.3949.06 ▼4.09
Media Library /wp-admin/upload.php1,415 ▲274.24 ▲0.01100.41 ▼8.3341.64 ▼6.85
WASP Anti-Spam /wp-admin/admin.php?page=ebk_page2,51310.77207.88124.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wasp-anti-spam/inc/admin-page-class/admin-page-class.php+277
    Undefined index: top
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=ebk_page
    • > Notice in wp-content/plugins/wasp-anti-spam/inc/admin-page-class/admin-page-class.php+277
    Undefined index: top

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wasp-anti-spam/init.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wasp-anti-spam/inc/profile.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wasp-anti-spam/inc/admin.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=ebk_page
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28609 "jQuery.Deferred exception: $el.live is not a function" "TypeError: $el.live is not a function\n at HTMLInputElement.\u003Canonymous> (/wp-content/plugins/wasp-anti-spam/inc/admin-page-class/js/Admin_Page_Class.js:231:13)\n at Function.each (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:3129)\n at e.\u003Ccomputed>.each (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:1594)\n at fancyCheckbox (/wp-content/plugins/wasp-anti-spam/inc/admin-page-class/js/Admin_Page_Class.js:226:18)\n at apc_init (/wp-content/plugins/wasp-anti-spam/inc/admin-page-class/js/Admin_Page_Class.js:45:3)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wasp-anti-spam/inc/admin-page-class/js/Admin_Page_Class.js:20:3)\n at e (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:26990)\n at t (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=ebk_page
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28721 Uncaught TypeError: $el.live is not a function

Optimizations

Plugin configuration 90% 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
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wasp-anti-spam === )
Please take inspiration from this readme.txt

wasp-anti-spam/init.php 85% from 13 tests

The main PHP script in "WASP - Anti Spam" version 1.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wasp-anti-spam.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin14,617 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript158068966,902
PO File141,0461,1922,996
PHP105921,6012,831
CSS122842491,888

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity71.14
▷ Minimum class complexity1.00
▷ Maximum class complexity384.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods174
▷ Static methods00.00%
▷ Public methods17198.28%
▷ Protected methods00.00%
▷ Private methods31.72%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin-page-class/images/delete-16.png1.74KB0.90KB▼ 48.23%
inc/admin-page-class/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
inc/admin-page-class/css/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
inc/admin-page-class/css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
inc/admin-page-class/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%