84% mini-preview

Code Review | Mini Preview

WordPress plugin Mini Preview scored84%from 54 tests.

About plugin

  • Plugin page: mini-preview
  • Plugin version: 1.3.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Mar 9, 2021
  • Latest release: Sep 10, 2022
  • Number of updates: 11
  • Update frequency: every 50.0 days
  • Top authors: garethhadfield (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /635 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼10.71ms] Passed 4 tests

Server-side resources used by Mini Preview
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.82 ▼2.84
Dashboard /wp-admin3.38 ▲0.0346.54 ▼16.69
Posts /wp-admin/edit.php3.49 ▲0.1346.95 ▼1.64
Add New Post /wp-admin/post-new.php5.98 ▲0.1082.13 ▼21.50
Media Library /wp-admin/upload.php3.30 ▲0.0732.56 ▼1.81
Mini Preview /wp-admin/options-general.php?page=mini_preview_settings3.2730.45

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Mini Preview
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.25 ▼1.042.04 ▲0.1443.21 ▲1.06
Dashboard /wp-admin2,207 ▲195.83 ▼0.0796.06 ▼20.4340.91 ▼3.48
Posts /wp-admin/edit.php2,093 ▲222.05 ▲0.0238.85 ▲3.1935.80 ▼3.60
Add New Post /wp-admin/post-new.php1,594 ▲6621.05 ▼2.07677.18 ▼15.2862.10 ▲8.76
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0497.83 ▼7.2541.86 ▼4.39
Mini Preview /wp-admin/options-general.php?page=mini_preview_settings8302.0627.7229.29

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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 shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mini-preview/mini-preview.php:309

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: editor, preview, tablet, desktop, responsive...

mini-preview/mini-preview.php Passed 13 tests

"Mini Preview" version 1.3.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
60 characters long description:
Displays a mini preview when a page or post is being edited.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected892 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113425520
PHP26412245
CSS1308127

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods23100.00%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin