68% ahrefs-seo

Code Review | Ahrefs SEO

WordPress plugin Ahrefs SEO scored 68% from 54 tests.

About plugin

  • Plugin page: ahrefs-seo
  • Plugin version: 0.9.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Mar 25, 2020
  • Latest release: Nov 10, 2021
  • Number of updates: 74
  • Update frequency: every 8.0 days
  • Top authors: justinahrefs (83.78%)handywp (10.81%)xsvet (8.11%)

Code review

54 tests

User reviews

17 reviews

Install metrics

7,000+ active / 94,339 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.26MB] [CPU: ▼130.45ms] Passed 4 tests

Server-side resources used by Ahrefs SEO
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲1.2155.97 ▲33.23
Dashboard /wp-admin4.34 ▲1.2966.40 ▲14.54
Posts /wp-admin/edit.php4.43 ▲1.3265.82 ▲13.63
Add New Post /wp-admin/post-new.php6.71 ▲1.28118.51 ▼553.55
Media Library /wp-admin/upload.php4.28 ▲1.2852.89 ▲3.57

Server storage [IO: ▲9.15MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,262 new files
Database: 2 new tables, 3 new options
New tables
wp_ahrefs_seo_content
wp_ahrefs_seo_snapshots
New WordPress options
ahrefs-seo-db-version
ahrefs-seo-last-hash
ahrefs-seo-content-rules-version

Browser metrics Passed 4 tests

An overview of browser requirements for Ahrefs SEO
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,756 ▲16115.83 ▲0.3911.55 ▲1.0351.66 ▼2.05
Dashboard /wp-admin3,021 ▲936.01 ▲0.04172.82 ▼3.54120.80 ▼9.12
Posts /wp-admin/edit.php2,796 ▲572.73 ▲0.0283.59 ▲8.5199.08 ▲8.02
Add New Post /wp-admin/post-new.php1,593 ▲1216.47 ▼1.03560.38 ▲88.87132.51 ▼12.12
Media Library /wp-admin/upload.php1,860 ▲535.06 ▲0.02186.49 ▲2.21137.05 ▲2.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_ahrefs_seo_snapshots
    • wp_ahrefs_seo_content
  • This plugin does not fully uninstall, leaving 6 options in the database
    • ahrefs-seo-last-hash
    • ahrefs-seo-audit-stopped
    • ahrefs-seo-audit-stop-reason
    • ahrefs-seo-content-rules-version
    • ahrefs-seo-audit-stop-reason-scheduled
    • ahrefs-seo-db-version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ahrefs-seo/php5/templates/parts/loader/settings-end.php
    • > /wp-content/plugins/ahrefs-seo/php5/templates/headers/footer.php
    • > /wp-content/plugins/ahrefs-seo/php7/templates/parts/content-tips/footer-hidden.php
    • > /wp-content/plugins/ahrefs-seo/php7/templates/headers/footer.php
    • > /wp-content/plugins/ahrefs-seo/php5/templates/parts/content-tips/footer-hidden.php
    • > /wp-content/plugins/ahrefs-seo/php7/templates/parts/loader/settings-end.php
  • 799× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo\\Cron_Any' not found in wp-content/plugins/ahrefs-seo/php5/class-cron-content-fast.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Monolog\\Formatter\\JsonFormatter' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Google\\Service\\Resource' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/google/apiclient-services/src/AnalyticsReporting/Resource/UserActivity.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'ahrefs\\AhrefsSeo_Vendor\\Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/guzzlehttp/psr7/src/UploadedFile.php:9
    • > PHP Warning
      Class 'ahrefs\\AhrefsSeo_Vendor\\Google\\Task\\Runner' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/google/apiclient/src/aliases.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/monolog/monolog/src/Monolog/Handler/GroupHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Google\\Collection' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1alphaListDisplayVideo360AdvertiserLinkProposalsResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Google\\Model' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/google/apiclient-services/src/Analytics/GoalUrlDestinationDetailsSteps.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ahrefs\\AhrefsSeo_Vendor\\Google\\Model' not found in wp-content/plugins/ahrefs-seo/vendor-prefixed/google/apiclient-services/src/AnalyticsReporting/MetricFilter.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: seo, content analysis, google search console, google analytics

ahrefs-seo/ahrefs-plugin.php 92% from 13 tests

The main PHP file in "Ahrefs SEO" ver. 0.9.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ahrefs-seo.php" instead of "ahrefs-plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected140,564 lines of code in 1,171 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,1014,87856,905128,500
Markdown341,77105,133
CSS2263384,191
JavaScript4742802,556
SVG2800171
JSON20013

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.02
▷ Minimum class complexity1.00
▷ Maximum class complexity633.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces77
Interfaces42
Traits8
Classes861
▷ Abstract classes313.60%
▷ Concrete classes83096.40%
▷ Final classes313.73%
Methods7,192
▷ Static methods6078.44%
▷ Public methods6,27687.26%
▷ Protected methods4336.02%
▷ Private methods4836.72%
Functions395
▷ Named functions11428.86%
▷ Anonymous functions28171.14%
Constants938
▷ Global constants889.38%
▷ Class constants85090.62%
▷ Public constants77090.59%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/chart-bg.png38.81KB9.11KB▼ 76.53%