78% cg-scroll-to-top

Code Review | CG Scroll To Top

WordPress plugin CG Scroll To Top scored78%from 54 tests.

About plugin

  • Plugin page: cg-scroll-to-top
  • Plugin version: 3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.1
  • WordPress version: 6.3.1
  • First release: Aug 24, 2016
  • Latest release: Mar 11, 2019
  • Number of updates: 32
  • Update frequency: every 29.1 days
  • Top authors: chandan_garg_129 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,514 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
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.45ms] Passed 4 tests

A check of server-side resources used by CG Scroll To Top
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0545.73 ▼0.22
Dashboard /wp-admin3.37 ▲0.0751.11 ▼3.62
Posts /wp-admin/edit.php3.48 ▲0.1258.70 ▲7.57
Add New Post /wp-admin/post-new.php5.94 ▲0.0689.29 ▼14.53
Media Library /wp-admin/upload.php3.27 ▲0.0439.08 ▲0.57
CG Scroll To Top /wp-admin/options-general.php?page=cg-scroll-to-top-plugin3.2939.41

Server storage [IO: ▲0.65MB] [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: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CG Scroll To Top
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲22114.99 ▲0.372.57 ▲0.8544.82 ▲0.90
Dashboard /wp-admin2,356 ▲1766.38 ▲0.76112.87 ▲20.1238.83 ▼2.93
Posts /wp-admin/edit.php2,290 ▲1903.55 ▲1.5455.39 ▲13.4537.31 ▲1.83
Add New Post /wp-admin/post-new.php1,547 ▲1923.28 ▲0.09666.66 ▼8.4039.15 ▼22.00
Media Library /wp-admin/upload.php1,430 ▲304.37 ▲0.1882.90 ▼25.7541.80 ▼2.29
CG Scroll To Top /wp-admin/options-general.php?page=cg-scroll-to-top-plugin1,7533.6268.1980.17

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
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cg-scroll-to-top/cg-scroll-css-jquery.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/cg-scroll-to-top/cg_scroll_to_top_backend.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cg-scroll-to-top/cg-scroll-to-top.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (**Custom scroller** - Blue color in the image shows the part of webpage scrolled and the unfilled part shows remaining contents in the page), #2 (**Scroller info** - It shows area of webpage left unread. Clicking on it will take you to the top of the page with animated effects.), #3 (**Custom Scroller Design** - It shows the admin panel from where you can customize your designs. Its very simple and easy to choose.), #4 (**Custom Scroller Settings** - It shows different options to choose for designing your own scroll to top icon as per your theme.)
You can look at the official readme.txt

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

The entry point to "CG Scroll To Top" version 3.5 is a PHP file that has certain tags in its header comment area
44 characters long description:
A Fancy Scroll to Top with lot's of effects.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected589 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP42016485
CSS18558
JavaScript20046

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.61MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
custom-scroller.png2.97KB1.44KB▼ 51.43%
scroller-info.png106.53KB30.42KB▼ 71.44%
screenshot-1.png2.97KB1.44KB▼ 51.43%
screenshot-4.png140.92KB39.63KB▼ 71.88%
screenshot-3.png132.86KB35.55KB▼ 73.24%