83% sc-to-top

Code Review | SC To Top

WordPress plugin SC To Top scored83%from 54 tests.

About plugin

  • Plugin page: sc-to-top
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Apr 24, 2015
  • Latest release: Jul 13, 2017
  • Number of updates: 11
  • Update frequency: every 73.7 days
  • Top authors: sergiuscosta (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /859 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.99ms] Passed 4 tests

Server-side resources used by SC To Top
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.40 ▼4.88
Dashboard /wp-admin3.33 ▼0.0145.72 ▼10.23
Posts /wp-admin/edit.php3.38 ▲0.0341.83 ▲0.95
Add New Post /wp-admin/post-new.php5.91 ▲0.0388.21 ▼13.79
Media Library /wp-admin/upload.php3.25 ▲0.0336.45 ▲6.36

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for SC To Top
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.51 ▼1.018.22 ▲6.5442.42 ▼0.99
Dashboard /wp-admin2,214 ▲485.65 ▼0.1183.58 ▼20.0737.83 ▼8.17
Posts /wp-admin/edit.php2,116 ▲161.98 ▼0.0136.74 ▼2.5130.69 ▼10.38
Add New Post /wp-admin/post-new.php1,550 ▲2418.23 ▼4.83623.84 ▲3.1690.95 ▲41.57
Media Library /wp-admin/upload.php1,416 ▲134.23 ▼0.09104.51 ▲0.8245.66 ▲2.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sc-to-top/functions/options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sc-to-top/functions/options.php:3

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 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === sc-to-top === )
  • Screenshots: Please describe screenshot #2 in sc-to-top/assets to your readme.txt
Please take inspiration from this readme.txt

sc-to-top/index.php 85% from 13 tests

"SC To Top" version 2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sc-to-top.php" instead of "index.php")

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 detected261 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP21714119
JSON10070
CSS10024
SVG19021
Markdown17014
JavaScript10113

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.26MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png63.12KB19.95KB▼ 68.39%
screenshot.png63.12KB19.95KB▼ 68.39%
wtfpl-badge.png2.91KB1.80KB▼ 37.92%
screenshot-2.png138.11KB37.78KB▼ 72.65%
img/arrow.png1.09KB0.27KB▼ 74.82%