78% jcwp-scroll-to-top

Code Review | jcwp scroll to top

WordPress plugin jcwp scroll to top scored78%from 54 tests.

About plugin

  • Plugin page: jcwp-scroll-to-top
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2
  • WordPress version: 6.3.1
  • First release: Jul 3, 2012
  • Latest release: Apr 16, 2015
  • Number of updates: 21
  • Update frequency: every 48.4 days
  • Top authors: jaschahal (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /12,317 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼9.43ms] Passed 4 tests

A check of server-side resources used by jcwp scroll to top
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1835.88 ▼1.64
Dashboard /wp-admin3.49 ▲0.1544.39 ▼13.57
Posts /wp-admin/edit.php3.60 ▲0.2548.12 ▼2.84
Add New Post /wp-admin/post-new.php6.07 ▲0.1989.84 ▼19.65
Media Library /wp-admin/upload.php3.41 ▲0.1933.74 ▲1.65
JCWP Scroll To Top /wp-admin/options-general.php?page=jcorgstp-plugin3.3630.61

Server storage [IO: ▲0.10MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 28 new options
New WordPress options
jcorgstp_linkback
jcorgstp_zindex
jcorgstp_position
widget_recent-posts
jcorgstp_scroleActivateAt
db_upgraded
jcorgstp_scrollText
jcorgstp_disableon_tablet
jcorgstp_scrollElementId
jcorgstp_active
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for jcwp scroll to top
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲15313.69 ▼0.959.03 ▲7.2543.81 ▲4.34
Dashboard /wp-admin2,210 ▲255.88 ▼0.01103.62 ▲1.7339.02 ▲1.08
Posts /wp-admin/edit.php2,096 ▲72.14 ▲0.1438.23 ▼4.1735.74 ▲0.68
Add New Post /wp-admin/post-new.php1,549 ▲3523.16 ▲5.53641.79 ▼2.9949.03 ▼3.37
Media Library /wp-admin/upload.php1,392 ▲44.20 ▼0.0595.68 ▼1.5142.18 ▼1.05
JCWP Scroll To Top /wp-admin/options-general.php?page=jcorgstp-plugin1,3002.0824.7946.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 28 options in the database
    • jcorgstp_textPadding
    • widget_theysaidso_widget
    • db_upgraded
    • jcorgstp_containerWidth
    • jcorgstp_position
    • widget_recent-comments
    • theysaidso_admin_options
    • jcorgstp_foreColor
    • can_compress_scripts
    • jcorgstp_scrollText
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=jcorgstp-plugin
    • > 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=jcorgstp-plugin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/jcwp-scroll-to-top/jcwp-scroll-to-top.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === jcwp-scroll-to-top === )
  • Screenshots: These screenshots do not have images: #1 (A screen shot of the options page), #2 (Shows a style at the bottom of the page)
The official readme.txt is a good inspiration

jcwp-scroll-to-top/jcwp-scroll-to-top.php Passed 13 tests

The primary PHP file in "jcwp scroll to top" version 1.7 is used by WordPress to initiate all plugin functionality
139 characters long description:
This plugin gives you granular control on styles and positioning of your 'Scroll to top' text. Many variety of easing animations supported.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin706 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2157240705
JavaScript1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.85
Average class complexity104.00
▷ Minimum class complexity104.00
▷ Maximum class complexity104.00
Average method complexity6.15
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1890.00%
▷ Protected methods00.00%
▷ Private methods210.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png3.21KB1.43KB▼ 55.48%
screenshot-1.png39.90KB20.56KB▼ 48.46%