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
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4339.20 ▲1.83
Dashboard /wp-admin3.96 ▲0.6554.33 ▲9.21
Posts /wp-admin/edit.php4.01 ▲0.6446.11 ▲2.23
Add New Post /wp-admin/post-new.php6.55 ▲0.6682.91 ▼0.96
Media Library /wp-admin/upload.php3.88 ▲0.6539.28 ▲2.42
Akismet Anti-spam /wp-admin/options-general.php?page=akismet-key-config3.87353.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
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.36 ▼0.201.91 ▲0.2342.95 ▲1.25
Dashboard /wp-admin2,226 ▲585.60 ▲0.0489.03 ▲0.2240.30 ▼1.28
Posts /wp-admin/edit.php2,101 ▲42.00 ▲0.0232.91 ▼2.5033.86 ▼3.73
Add New Post /wp-admin/post-new.php1,529 ▲323.60 ▲0.48683.12 ▲19.0947.69 ▼3.33
Media Library /wp-admin/upload.php1,404 ▲14.22 ▲0.0593.75 ▼12.8940.57 ▼4.85
Akismet Anti-spam /wp-admin/options-general.php?page=akismet-key-config9652.0526.9350.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:
LanguageFilesBlank linesComment linesLines of code
PHP207387503,494
CSS5283181,785
JavaScript3160100528
SVG2002

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 code0.50
Average class complexity115.20
▷ Minimum class complexity6.00
▷ Maximum class complexity304.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods134
▷ Static methods12694.03%
▷ Public methods12593.28%
▷ Protected methods00.00%
▷ Private methods96.72%
Functions62
▷ Named functions62100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.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
FileSize - originalSize - compressedSavings
_inc/img/akismet-refresh-logo@2x.png2.72KB2.91KB0.00%
_inc/img/logo-full-2x.png4.93KB4.69KB▼ 4.97%
_inc/img/logo-a-2x.png0.88KB1.10KB0.00%