10% smart-wp-seo

Code Review | Smart Wordpress SEO

WordPress plugin Smart Wordpress SEO scored10%from 54 tests.

About plugin

  • Plugin page: smart-wp-seo
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Nov 13, 2014
  • Latest release: Apr 28, 2016
  • Number of updates: 16
  • Update frequency: every 33.3 days
  • Top authors: purab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /6,243 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php+19
    Use of undefined constant SWS_PLUGIN_TITLE - assumed 'SWS_PLUGIN_TITLE' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼58.46ms] Passed 4 tests

Server-side resources used by Smart Wordpress SEO
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.25 ▼38.57
Dashboard /wp-admin2.05 ▼1.265.70 ▼48.62
Posts /wp-admin/edit.php2.05 ▼1.315.34 ▼46.67
Add New Post /wp-admin/post-new.php2.05 ▼3.846.60 ▼99.96
Media Library /wp-admin/upload.php2.05 ▼1.185.15 ▼33.70
Social Info /wp-admin/admin.php?page=sws-social2.056.62
XML sitemap /wp-admin/admin.php?page=sws-xmlsitemap2.056.60
Smart SEO /wp-admin/admin.php?page=sws-dashboard2.055.61
Image SEO /wp-admin/admin.php?page=sws-images2.056.44

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
sws_images_override
sws_images_title
theysaidso_admin_options
sws_images_override_title
can_compress_scripts
db_upgraded
sws_images_alt

Browser metrics Passed 4 tests

Checking browser requirements for Smart Wordpress SEO
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲12514.70 ▲0.411.71 ▲0.0246.06 ▲0.29
Dashboard /wp-admin2,277 ▲1005.66 ▼0.0694.35 ▲6.2742.33 ▲1.35
Posts /wp-admin/edit.php2,183 ▲832.03 ▲0.0135.28 ▼0.6133.08 ▼6.49
Add New Post /wp-admin/post-new.php6,325 ▲4,79925.99 ▲2.44937.19 ▲246.6868.33 ▲13.49
Media Library /wp-admin/upload.php1,483 ▲864.23 ▲0.0498.62 ▼2.8945.48 ▲0.63
Social Info /wp-admin/admin.php?page=sws-social9362.0123.3724.79
XML sitemap /wp-admin/admin.php?page=sws-xmlsitemap1,3292.0127.0030.10
Smart SEO /wp-admin/admin.php?page=sws-dashboard9562.0122.4636.20
Image SEO /wp-admin/admin.php?page=sws-images9912.0423.4323.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php+19
    Use of undefined constant SWS_PLUGIN_TITLE - assumed 'SWS_PLUGIN_TITLE' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 10 options
    • sws_images_override
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • sws_images_alt
    • sws_images_title
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • sws_images_override_title

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sws-images
    • > Warning in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php+19
    Use of undefined constant SWS_PLUGIN_TITLE - assumed 'SWS_PLUGIN_TITLE' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sws-images
    • > Warning in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php+21
    Use of undefined constant SMT_HOME_KEYWORDS - assumed 'SMT_HOME_KEYWORDS' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sws-images
    • > Warning in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php+22
    Use of undefined constant SMT_HOME_DESCRIPTION - assumed 'SMT_HOME_DESCRIPTION' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sws-dashboard
    • > Notice in wp-content/plugins/smart-wp-seo/lib/sws_site_admin_options.php+21
    Undefined index: action

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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/smart-wp-seo/lib/sws_xmlsitemap.php:140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-wp-seo/lib/sws_site_admin_options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/smart-wp-seo/lib/sws_post_meta.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-wp-seo/smart-wordpresss-seo.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/smart-wp-seo/lib/sws_images.php:185

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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: live, bing, search engine, image seo, wordpress seo...

smart-wp-seo/smart-wordpresss-seo.php 85% from 13 tests

The primary PHP file in "Smart Wordpress SEO" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-wp-seo.php" instead of "smart-wordpresss-seo.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin773 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8138110748
CSS14025

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.50
▷ Minimum class complexity9.00
▷ Maximum class complexity14.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected