78% akismet

Code Review | Akismet Spam Protection

WordPress plugin Akismet Spam Protection scored 78% from 54 tests.

About plugin

  • Plugin page: akismet
  • Plugin version: 4.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Oct 20, 2005
  • Latest release: Oct 1, 2021
  • Number of updates: 982
  • Update frequency: every 6.0 days
  • Top authors: cfinke (35.44%)tellyworth (23.42%)josephscott (11.41%)eoigal (7.54%)matt (5.6%)

Code review

54 tests

User reviews

927 reviews

Install metrics

5,000,000+ active / 223,006,755 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by Akismet Spam Protection
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 2,285.57ms on /wp-admin/options-general.php?page=akismet-key-config)
PageMemory (MB)CPU Time (ms)
Home /3.21 ▲0.3837.14 ▲4.11
Dashboard /wp-admin3.69 ▲0.6450.25 ▲6.01
Posts /wp-admin/edit.php3.74 ▲0.6245.98 ▼4.88
Add New Post /wp-admin/post-new.php6.01 ▲0.5799.70 ▼549.71
Media Library /wp-admin/upload.php3.63 ▲0.6343.12 ▲9.74
Akismet Anti-Spam /wp-admin/options-general.php?page=akismet-key-config3.622,285.57

Server storage [IO: ▲0.24MB] [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: 27 new files
Database: no new tables, 1 new option
New WordPress options
widget_akismet_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Akismet Spam Protection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,717 ▲8016.01 ▲0.4810.01 ▲0.7352.67 ▼0.93
Dashboard /wp-admin3,011 ▲806.05 ▼0.05141.19 ▼15.03108.51 ▼17.04
Posts /wp-admin/edit.php2,741 ▲22.68 ▲0.0065.71 ▼8.0091.03 ▼2.35
Add New Post /wp-admin/post-new.php1,675 ▼819.09 ▲0.31394.45 ▲11.57113.43 ▲6.31
Media Library /wp-admin/upload.php1,812 ▲54.99 ▼0.04156.19 ▼11.16132.48 ▲4.88
Akismet Anti-Spam /wp-admin/options-general.php?page=akismet-key-config1,2622.0954.4780.64

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: 1 option
    • widget_akismet_widget

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
  • 31× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/akismet/views/enter.php:2
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 160
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/akismet/views/stats.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/akismet/class.akismet-cli.php:3
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/akismet/views/predefined.php:2
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/akismet/views/notice.php on line 92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/akismet/views/setup.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Akismet' not found in wp-content/plugins/akismet/views/activate.php:2

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: contact form, antispam, comments, anti-spam, spam comments...

akismet/akismet.php 92% from 13 tests

The main PHP file in "Akismet Spam Protection" ver. 4.2.1 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 279 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 plugin4,216 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP196886673,297
CSS1863629
JavaScript17655290

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 complexity109.00
▷ Minimum class complexity6.00
▷ Maximum class complexity279.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods131
▷ Static methods12393.89%
▷ Public methods12293.13%
▷ Protected methods00.00%
▷ Private methods96.87%
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
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_inc/img/logo-a-2x.png0.88KB1.10KB0.00%
_inc/img/logo-full-2x.png4.93KB4.69KB▼ 4.97%