84% akamai

Code Review | Akamai for WordPress

WordPress plugin Akamai for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: akamai
  • Plugin version: 0.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9
  • WordPress version: 6.3.1
  • First release: Feb 11, 2010
  • Latest release: Mar 30, 2018
  • Number of updates: 11
  • Update frequency: every 269.5 days
  • Top authors: dshafik (54.55%)akamaidevrel (54.55%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /10,280 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.64ms] Passed 4 tests

Server-side resources used by Akamai for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0436.22 ▼3.87
Dashboard /wp-admin3.33 ▲0.0345.33 ▼2.06
Posts /wp-admin/edit.php3.45 ▲0.0944.35 ▼2.55
Add New Post /wp-admin/post-new.php5.93 ▲0.0580.74 ▼22.08
Media Library /wp-admin/upload.php3.26 ▲0.0337.15 ▲3.73

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 55 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
akamai-version
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Akamai for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲11413.34 ▼1.031.82 ▲0.0941.21 ▼5.66
Dashboard /wp-admin2,233 ▲454.87 ▼1.03101.26 ▼1.6941.51 ▼4.47
Posts /wp-admin/edit.php2,110 ▲212.04 ▼0.0235.95 ▼7.1035.86 ▼1.67
Add New Post /wp-admin/post-new.php1,536 ▲2223.22 ▲5.71591.69 ▼98.9851.01 ▼8.87
Media Library /wp-admin/upload.php1,412 ▲244.23 ▲0.04103.67 ▼6.4542.38 ▼5.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • akamai-version
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/bootstrap.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Akamai\\Open\\EdgeGrid\\Authentication\\Exception\\SignerException' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/src/Authentication/Exception/SignerException/InvalidSignDataException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/Authentication/TimestampTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Akamai\\Open\\EdgeGrid\\Authentication\\Exception' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/src/Authentication/Exception/ConfigException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/AuthenticationTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Akamai\\Open\\EdgeGrid\\Authentication\\Exception' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/src/Authentication/Exception/SignerException.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/akamai/admin/partials/akamai-admin-display.php:3
    • > PHP Warning
      require_once(wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/bootstrap.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/akamai/vendor/akamai-open/edgegrid-auth/tests/Authentication/NonceTest.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: purge, akamai, cache, cdn

akamai/akamai.php Passed 13 tests

The main file in "Akamai for WordPress" v. 0.6.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
57 characters long description:
Akamai for WordPress Plugin. Control Akamai CDN and more.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,447 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP203879601,801
JSON300250
YAML3731129
Markdown2440113
Bourne Shell18147
JavaScript2135547
CSS26440
XML111020

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity8.60
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods121
▷ Static methods75.79%
▷ Public methods10485.95%
▷ Protected methods1411.57%
▷ Private methods32.48%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png11.48KB5.77KB▼ 49.74%
assets/icon-128x128.png5.60KB3.18KB▼ 43.16%
assets/screenshot-1.png186.58KB57.46KB▼ 69.20%