73% swaysmart

Code Review | Swaysmart

WordPress plugin Swaysmart scored73%from 54 tests.

About plugin

  • Plugin page: swaysmart
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 23, 2017
  • Latest release: Apr 23, 2017
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: clearsky1002 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /668 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.59ms] Passed 4 tests

Server-side resources used by Swaysmart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.03 ▼4.32
Dashboard /wp-admin3.32 ▼0.0246.02 ▼17.50
Posts /wp-admin/edit.php3.37 ▲0.0244.28 ▼5.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.59 ▼14.95
Media Library /wp-admin/upload.php3.25 ▲0.0237.22 ▲1.08
Swaysmart /wp-admin/options-general.php?page=swaysmart/swaysmart.php3.1932.89

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
sway_insert_header
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Swaysmart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.36 ▼0.021.64 ▲0.0940.20 ▼3.93
Dashboard /wp-admin2,199 ▲195.54 ▼0.0685.08 ▼10.4336.78 ▼0.23
Posts /wp-admin/edit.php2,107 ▲42.00 ▲0.0337.52 ▼4.1732.55 ▼0.47
Add New Post /wp-admin/post-new.php6,236 ▲4,71019.01 ▼3.98854.26 ▲264.0289.10 ▲25.44
Media Library /wp-admin/upload.php1,407 ▲74.22 ▲0.04101.60 ▼7.9342.19 ▼1.77
Swaysmart /wp-admin/options-general.php?page=swaysmart/swaysmart.php8201.9925.9129.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • sway_insert_header
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=swaysmart/swaysmart.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=swaysmart/swaysmart.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/swaysmart/meta.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swaysmart/swaysmart.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: post, head, header, swaysmart, admin...

swaysmart/swaysmart.php Passed 13 tests

"Swaysmart" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
88 characters long description:
This plugin allows you to add swaysmart javascript in the header of your Wordpress site.

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 plugin152 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23917152

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected