78% akismet

Code Review | Akismet Anti-spam: Spam Protection

WordPress plugin Akismet Anti-spam: Spam Protection scored78%from 54 tests.

About plugin

  • Plugin page: akismet
  • Plugin version: 5.3
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Oct 20, 2005
  • Latest release: Sep 13, 2023
  • Number of updates: 1,027
  • Update frequency: every 6.4 days
  • Top authors: cfinke (36.12%)tellyworth (22.4%)josephscott (10.91%)eoigal (7.21%)matt (5.36%)

Code review

54 tests

User reviews

998 reviews

Install metrics

5,000,000+ active /302,051,699 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.59MB] [CPU: ▲1.38ms] Passed 4 tests

A check of server-side resources used by Akismet Anti-spam: Spam Protection
Normal server usage
Page Memory (MB) CPU Time (ms)
Home / 3.90 ▲0.43 39.20 ▲1.83
Dashboard /wp-admin 3.96 ▲0.65 54.33 ▲9.21
Posts /wp-admin/edit.php 4.01 ▲0.64 46.11 ▲2.23
Add New Post /wp-admin/post-new.php 6.55 ▲0.66 82.91 ▼0.96
Media Library /wp-admin/upload.php 3.88 ▲0.65 39.28 ▲2.42
Akismet Anti-spam /wp-admin/options-general.php?page=akismet-key-config 3.87 353.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_akismet_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Akismet Anti-spam: Spam Protection
There were no issues detected in relation to browser resource usage
Page Nodes Memory (MB) Script (ms) Layout (ms)
Home / 2,848 ▲87 14.36 ▼0.20 1.91 ▲0.23 42.95 ▲1.25
Dashboard /wp-admin 2,226 ▲58 5.60 ▲0.04 89.03 ▲0.22 40.30 ▼1.28
Posts /wp-admin/edit.php 2,101 ▲4 2.00 ▲0.02 32.91 ▼2.50 33.86 ▼3.73
Add New Post /wp-admin/post-new.php 1,529 ▲3 23.60 ▲0.48 683.12 ▲19.09 47.69 ▼3.33
Media Library /wp-admin/upload.php 1,404 ▲1 4.22 ▲0.05 93.75 ▼12.89 40.57 ▼4.85
Akismet Anti-spam /wp-admin/options-general.php?page=akismet-key-config 965 2.05 26.93 50.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_akismet_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/akismet/akismet.php
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Akismet' not found in wp-content/plugins/akismet/views/connect-jp.php:8
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 54
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 86
    • > PHP Fatal error
      Uncaught Error: Class 'Akismet' not found in wp-content/plugins/akismet/views/activate.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/akismet/views/logo.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/akismet/views/get.php:14
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 220
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/akismet/views/title.php:2
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 97

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: comment moderation, spam, contact form, spam comments, anti-spam...

akismet/akismet.php 92% from 13 tests

The main PHP file in "Akismet Anti-spam: Spam Protection" ver. 5.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 294 characters long)

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
There were no executable files found in this plugin5,809 lines of code in 30 files:
Language Files Blank lines Comment lines Lines of code
PHP 20 738 750 3,494
CSS 5 283 18 1,785
JavaScript 3 160 100 528
SVG 2 0 0 2

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code 0.50
Average class complexity 115.20
▷ Minimum class complexity 6.00
▷ Maximum class complexity 304.00
Average method complexity 5.26
▷ Minimum method complexity 1.00
▷ Maximum method complexity 43.00
Code structure
Namespaces 0
Interfaces 0
Traits 0
Classes 5
▷ Abstract classes 0 0.00%
▷ Concrete classes 5 100.00%
▷ Final classes 0 0.00%
Methods 134
▷ Static methods 126 94.03%
▷ Public methods 125 93.28%
▷ Protected methods 0 0.00%
▷ Private methods 9 6.72%
Functions 62
▷ Named functions 62 100.00%
▷ Anonymous functions 0 0.00%
Constants 8
▷ Global constants 4 50.00%
▷ Class constants 4 50.00%
▷ Public constants 4 100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
File Size - original Size - compressed Savings
_inc/img/[email protected] 2.72KB 2.91KB 0.00%
_inc/img/logo-full-2x.png 4.93KB 4.69KB ▼ 4.97%
_inc/img/logo-a-2x.png 0.88KB 1.10KB 0.00%