84% simple-preview

Code Review | Simple Preview

WordPress plugin Simple Preview scored84%from 54 tests.

About plugin

  • Plugin page: simple-preview
  • Plugin version: 0.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.9.8
  • WordPress version: 6.3.1
  • First release: Mar 2, 2010
  • Latest release: Aug 3, 2018
  • Number of updates: 26
  • Update frequency: every 139.8 days
  • Top authors: gabrielmcgovern (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /6,970 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.69MB] [CPU: ▼21.67ms] Passed 4 tests

Server-side resources used by Simple Preview
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.88 ▼4.09
Dashboard /wp-admin3.33 ▼0.0243.61 ▼17.71
Posts /wp-admin/edit.php3.38 ▲0.0249.59 ▲1.86
Add New Post /wp-admin/post-new.php3.11 ▼2.7734.63 ▼64.28
Media Library /wp-admin/upload.php3.25 ▲0.0230.88 ▼0.58

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
simple_preview
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Preview
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.151.71 ▲0.0142.85 ▼0.93
Dashboard /wp-admin2,206 ▲274.86 ▼0.99107.86 ▼14.3141.12 ▼6.53
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.1539.89 ▲2.4434.53 ▼1.77
Add New Post /wp-admin/post-new.php1,537 ▲2323.10 ▲5.44635.34 ▼52.4357.91 ▲5.51
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0198.66 ▼11.7342.02 ▼5.30

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
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/simple-preview/simple-preview.php:56

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: simple-preview, draft, posts, public, preview...

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

This is the main PHP file of "Simple Preview" version 0.1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
98 characters long description:
Enables you to give a link to anonymous users for public preview of a post before it is published.

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 detected89 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2304989

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected