84% topgrade

Code Review | Topgrade

WordPress plugin Topgrade scored 84% from 54 tests.

About plugin

  • Plugin page: topgrade
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 28, 2018
  • Latest release: Aug 28, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: topgradeapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 881 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Topgrade
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.36 ▲1.17
Dashboard /wp-admin3.36 ▲0.0544.89 ▼3.22
Posts /wp-admin/edit.php3.47 ▲0.1144.41 ▼4.10
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.41 ▼22.05
Media Library /wp-admin/upload.php3.28 ▲0.0535.36 ▲1.37

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Topgrade
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲16813.60 ▼0.788.85 ▲7.1643.52 ▼0.58
Dashboard /wp-admin2,223 ▲415.80 ▼0.1097.25 ▼4.3039.95 ▼3.92
Posts /wp-admin/edit.php2,106 ▲171.99 ▼0.0535.74 ▼7.7833.13 ▼2.59
Add New Post /wp-admin/post-new.php1,534 ▲1723.15 ▲5.55629.41 ▲4.4073.14 ▼1.75
Media Library /wp-admin/upload.php1,405 ▲174.21 ▼0.01107.13 ▲6.3846.40 ▲1.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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)
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/topgrade/public/partials/topgradeapp-public-display.php
    • > /wp-content/plugins/topgrade/admin/partials/topgradeapp-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #5, #0 in topgrade/assets to your readme.txt
Please take inspiration from this readme.txt

topgrade/topgrade.php 92% from 13 tests

The main PHP script in "Topgrade" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin220 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13132530214
JavaScript24546
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.39MB with 0.25MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/topgrade2.png104.03KB36.99KB▼ 64.44%
public/topgrade3.png121.64KB44.12KB▼ 63.73%
public/topgrade1.png172.36KB56.39KB▼ 67.28%