94% tungtop-quick-preview-post

Code Review | Admin Quick Preview Post

WordPress plugin Admin Quick Preview Post scored 94% from 54 tests.

About plugin

  • Plugin page: tungtop-quick-pre...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.2
  • WordPress version: 5.8.1
  • First release: Jan 7, 2020
  • Latest release: Apr 7, 2020
  • Number of updates: 6
  • Update frequency: every 15.3 days
  • Top authors: truongthanhtungitvn (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 596 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼137.27ms] Passed 4 tests

An overview of server-side resources used by Admin Quick Preview Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1337.90 ▲14.27
Dashboard /wp-admin3.08 ▲0.0253.48 ▲9.31
Posts /wp-admin/edit.php3.13 ▲0.0254.09 ▲5.58
Add New Post /wp-admin/post-new.php5.44 ▲0.01104.12 ▼555.96
Media Library /wp-admin/upload.php3.02 ▲0.0134.95 ▼8.02

Server storage [IO: ▲0.19MB] [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: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Admin Quick Preview Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,726 ▲13116.17 ▲0.579.47 ▼0.3753.86 ▲5.68
Dashboard /wp-admin2,990 ▲566.56 ▲0.65154.84 ▲2.19117.48 ▲2.24
Posts /wp-admin/edit.php2,812 ▲732.71 ▼0.0173.31 ▲2.37120.54 ▲26.92
Add New Post /wp-admin/post-new.php1,699 ▲1218.47 ▼0.39368.21 ▼54.89144.56 ▲14.07
Media Library /wp-admin/upload.php1,830 ▲235.47 ▲0.45143.90 ▼12.63134.41 ▼6.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

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
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/tungtop-quick-preview-post/admin-quick-preview-post.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention: You can take inspiration from this readme.txt

tungtop-quick-preview-post/admin-quick-preview-post.php 92% from 13 tests

The main PHP script in "Admin Quick Preview Post" version 1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("tungtop-quick-preview-post.php" instead of "admin-quick-preview-post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin164 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS111381
PHP1121163
JavaScript13220

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.18MB with 0.13MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot/screenshot.png186.17KB48.65KB▼ 73.87%