78% m7-go-top

Code Review | M7 Go Top

WordPress plugin M7 Go Top scored78%from 54 tests.

About plugin

  • Plugin page: m7-go-top
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.8
  • WordPress version: 6.3.1
  • First release: Apr 12, 2013
  • Latest release: Dec 12, 2013
  • Number of updates: 23
  • Update frequency: every 10.6 days
  • Top authors: muxahuk1214 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /3,011 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.11ms] Passed 4 tests

This is a short check of server-side resources used by M7 Go Top
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.06 ▼6.59
Dashboard /wp-admin3.37 ▲0.0647.24 ▲1.29
Posts /wp-admin/edit.php3.48 ▲0.1250.58 ▲1.67
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.41 ▼12.79
Media Library /wp-admin/upload.php3.29 ▲0.0635.27 ▲1.88
M7 Go Top /wp-admin/options-general.php?page=m7-go-top3.7031.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
m7_go_top_version
m7_go_top_options
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by M7 Go Top
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.40 ▼0.251.66 ▼0.3044.09 ▼2.92
Dashboard /wp-admin2,210 ▲224.83 ▼1.07108.53 ▲6.0641.22 ▼1.78
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0338.29 ▼4.5234.88 ▼0.19
Add New Post /wp-admin/post-new.php1,537 ▲1823.22 ▲0.07632.64 ▼18.4049.75 ▼17.49
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0299.25 ▼3.6141.37 ▼5.01
M7 Go Top /wp-admin/options-general.php?page=m7-go-top3,0004.20128.6478.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=m7-go-top
    • > 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=m7-go-top
    • > 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/m7-go-top/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/m7-go-top/frontend.php:1

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === m7-go-top === )
You can take inspiration from this readme.txt

m7-go-top/m7-go-top.php Passed 13 tests

The main PHP script in "M7 Go Top" version 1.1 is automatically included on every request by WordPress
110 characters long description:
Creates "To Top" link on your website, so that visitors could get back to the top of page. Fully customizable.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,591 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4961491,897
PO File1140301313
JavaScript25748245
CSS130136

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity84.50
▷ Minimum class complexity34.00
▷ Maximum class complexity135.00
Average method complexity7.42
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods13.85%
▷ Public methods26100.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
4 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/faq.png0.46KB0.30KB▼ 34.33%
images/icons/donate.png1.07KB0.88KB▼ 17.58%
images/icons/settings.png1.78KB1.44KB▼ 19.16%
images/top.png78.32KB0.15KB▼ 99.81%