82% wp-seostats

Code Review | WP-SEOstats

WordPress plugin WP-SEOstats scored 82% from 54 tests.

About plugin

  • Plugin page: wp-seostats
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-3.6.0
  • WordPress version: 5.8.1
  • First release: Dec 9, 2013
  • Latest release: Dec 24, 2014
  • Number of updates: 37
  • Update frequency: every 10.3 days
  • Top authors: drmosko (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 4,816 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.08MB] [CPU: ▲97.18ms] Passed 4 tests

This is a short check of server-side resources used by WP-SEOstats
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.152,296.32 ▲2,271.57
Dashboard /wp-admin3.07 ▲0.01284.17 ▲230.29
Posts /wp-admin/edit.php3.12 ▲0.01291.51 ▲247.78
Add New Post /wp-admin/post-new.php5.03 ▼0.40329.10 ▼330.82
Media Library /wp-admin/upload.php3.07 ▲0.07282.62 ▲241.47
Semrush Graphs /wp-admin/admin.php?page=WP_SEOstats_admin_semrush_graphs3.05282.21
Alexa graphs /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs3.05278.39
WP-SEOstats /wp-admin/admin.php?page=WP_SEOstats_options3.06329.95
Majestic SEO Graphs /wp-admin/admin.php?page=WP_SEOstats_admin_Majestic_SEO3.05282.19

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 39 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WP-SEOstats
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,596 ▼1,0004.04 ▼11.518.04 ▼1.6051.73 ▼0.80
Dashboard /wp-admin3,159 ▲2295.95 ▼0.02136.55 ▼41.42148.93 ▲34.29
Posts /wp-admin/edit.php2,783 ▲442.68 ▼0.0069.14 ▼3.7887.57 ▲1.46
Add New Post /wp-admin/post-new.php1,711 ▲2818.72 ▲0.26385.23 ▼3.43116.29 ▼0.16
Media Library /wp-admin/upload.php1,854 ▲475.02 ▼0.02166.61 ▲16.39122.44 ▼2.01
Semrush Graphs /wp-admin/admin.php?page=WP_SEOstats_admin_semrush_graphs1,0592.0551.6465.74
Alexa graphs /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs1,1582.0554.9575.98
WP-SEOstats /wp-admin/admin.php?page=WP_SEOstats_options1,1552.0956.4570.48
Majestic SEO Graphs /wp-admin/admin.php?page=WP_SEOstats_admin_Majestic_SEO1,0942.0953.0766.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Majestic_SEO
    • > Warning in wp-content/plugins/wp-seostats/Alexa-xml.php+13
    simplexml_load_file(): http://data.alexa.com/data?cli=10&dat=snbamz&url=http://wp.com:1: parser error : Start tag expected, '<' not found
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Majestic_SEO
    • > Warning in wp-content/plugins/wp-seostats/Alexa-xml.php+13
    simplexml_load_file(): Okay
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Majestic_SEO
    • > Warning in wp-content/plugins/wp-seostats/Alexa-xml.php+13
    simplexml_load_file(): ^

SRP 50% 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 take a closer look at the following
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/wp-seostats/Alexa-xml.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SEOstats\\SEOstats' not found in wp-content/plugins/wp-seostats/SEOstats/Services/Mozscape.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'SEOstats\\SEOstats' not found in wp-content/plugins/wp-seostats/SEOstats/Services/Social.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SEOstats\\SEOstats' not found in wp-content/plugins/wp-seostats/SEOstats/Services/Alexa.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-seostats/WP-SEOstats.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'SEOstats\\SEOstats' not found in wp-content/plugins/wp-seostats/SEOstats/Services/SemRush.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-seostats/SemRush-Graph.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-seostats/Alexa-Graph.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-seostats/Majestic-SEO.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SEOstats\\SEOstats' not found in wp-content/plugins/wp-seostats/SEOstats/Services/OpenSiteExplorer.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=t&b=ffffff&n=666666&w=660&h=330&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=p&b=ffffff&n=666666&w=660&h=330&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=u&b=ffffff&n=666666&w=660&h=330&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=s&b=ffffff&n=666666&w=660&h=330&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=b&b=ffffff&n=666666&w=660&h=330&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/admin.php?page=WP_SEOstats_admin_Alexa_graphs
    • > Network (severe)
    http://traffic.alexa.com/graph?&o=f&c=1&y=q&b=ffffff&n=666666&w=320&h=240&r=1m&u=wp.com - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-seostats/WP-SEOstats.php 85% from 13 tests

"WP-SEOstats" version 2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-seostats.php" instead of "WP-SEOstats.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected2,668 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP254751,0942,296
PO File293206372

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.62
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces5
Interfaces6
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods144
▷ Static methods10069.44%
▷ Public methods12385.42%
▷ Protected methods53.47%
▷ Private methods1611.11%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants50
▷ Global constants1020.00%
▷ Class constants4080.00%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/OSE.png1.19KB0.36KB▼ 69.98%
img/Alexa.png1.32KB0.48KB▼ 63.63%
img/arrow-up.png0.95KB0.17KB▼ 81.83%
img/arrow-down.png0.95KB0.17KB▼ 81.85%
img/Google.png1.29KB0.48KB▼ 62.96%