84% cp-scroll-to-top

Code Review | CakePress Scroll to top

WordPress plugin CakePress Scroll to top scored 84% from 54 tests.

About plugin

  • Plugin page: cp-scroll-to-top
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.8
  • WordPress version: 6.3.1
  • First release: Jan 25, 2018
  • Latest release: Jan 25, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: jqrambo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.78ms] Passed 4 tests

An overview of server-side resources used by CakePress Scroll to top
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.14 ▼1.90
Dashboard /wp-admin3.34 ▲0.0445.89 ▼5.37
Posts /wp-admin/edit.php3.39 ▲0.0448.92 ▲0.97
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.11 ▼8.80
Media Library /wp-admin/upload.php3.26 ▲0.0434.72 ▲2.41

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for CakePress Scroll to top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲18114.09 ▼0.238.25 ▲6.3941.34 ▼6.43
Dashboard /wp-admin2,206 ▲185.91 ▲0.10111.71 ▼1.8441.32 ▼5.12
Posts /wp-admin/edit.php2,092 ▲32.06 ▲0.0539.32 ▲1.8634.07 ▼2.22
Add New Post /wp-admin/post-new.php1,539 ▼323.17 ▲4.73722.02 ▲123.2157.22 ▲6.94
Media Library /wp-admin/upload.php1,385 ▼34.19 ▼0.01100.79 ▲6.4448.26 ▲5.62

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 detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-scroll-to-top/admin/CP-scroll-to-top-customizer.php:201
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-scroll-to-top/CP-scroll-to-top.php:51

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: scroll, smooth, top, responsive, jquery...

cp-scroll-to-top/CP-scroll-to-top.php 85% from 13 tests

The primary PHP file in "CakePress Scroll to top" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 185 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("cp-scroll-to-top.php" instead of "CP-scroll-to-top.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin242 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22150191
CSS13033
JavaScript11618

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 images were found in this plugin