73% as-scroll-to-top

Code Review | AS Scroll to top

WordPress plugin AS Scroll to top scored73%from 54 tests.

About plugin

  • Plugin page: as-scroll-to-top
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Jun 16, 2014
  • Latest release: Jun 16, 2014
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: ashikur11 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,360 total downloads

Benchmarks

Plugin footprint 65% 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.94MB] [CPU: ▼40.19ms] Passed 4 tests

This is a short check of server-side resources used by AS Scroll to top
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0627.76 ▼21.34
Dashboard /wp-admin3.01 ▼0.3028.60 ▼32.11
Posts /wp-admin/edit.php3.01 ▼0.3527.65 ▼31.94
Add New Post /wp-admin/post-new.php3.01 ▼2.8827.65 ▼75.36
Media Library /wp-admin/upload.php3.01 ▼0.2222.72 ▼11.57

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

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

Browser metrics Passed 4 tests

AS Scroll to top: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲16113.51 ▼0.939.40 ▲7.4744.93 ▼0.01
Dashboard /wp-admin2,214 ▲375.61 ▼0.0484.72 ▼15.5938.56 ▼5.29
Posts /wp-admin/edit.php2,116 ▲162.03 ▲0.0239.51 ▼2.2535.48 ▲2.15
Add New Post /wp-admin/post-new.php1,539 ▲1123.47 ▲0.36666.92 ▲12.0959.07 ▲13.98
Media Library /wp-admin/upload.php1,419 ▲224.13 ▼0.06104.37 ▼1.6444.52 ▲0.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/as-scroll-to-top/plugin-hook.php+162
    Non-static method AS_Plug_op::create_menu_page() should not be called statically
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/as-scroll-to-top/plugin-hook.php:20

User-side errors Passed 1 test

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

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 require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === as-scroll-to-top === )
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

as-scroll-to-top/plugin-hook.php 85% from 13 tests

This is the main PHP file of "AS Scroll to top" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("as-scroll-to-top.php" instead of "plugin-hook.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin542 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
SVG100414
PHP13725114
CSS20314

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon.png1.28KB0.45KB▼ 64.40%
img/icon-two.png3.69KB0.72KB▼ 80.47%