89% previewoneditor

Code Review | PreviewOnEditor

WordPress plugin PreviewOnEditor scored89%from 54 tests.

About plugin

  • Plugin page: previewoneditor
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: May 5, 2019
  • Latest release: Dec 12, 2020
  • Number of updates: 6
  • Update frequency: every 98.2 days
  • Top authors: macha795 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /923 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by PreviewOnEditor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0140.12 ▲1.29
Dashboard /wp-admin3.31 ▲0.0144.54 ▲0.28
Posts /wp-admin/edit.php3.36 ▲0.0149.63 ▲1.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.90 ▼3.04
Media Library /wp-admin/upload.php3.23 ▲0.0135.85 ▲3.62

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for PreviewOnEditor
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.77 ▲0.481.80 ▼0.1942.85 ▼5.35
Dashboard /wp-admin2,206 ▲184.85 ▼1.00109.75 ▲1.5542.84 ▲3.54
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0439.61 ▼0.9636.71 ▼5.14
Add New Post /wp-admin/post-new.php1,533 ▼1122.76 ▲4.64678.80 ▲42.8861.66 ▲8.37
Media Library /wp-admin/upload.php1,385 ▼64.23 ▲0.0492.66 ▼8.2042.24 ▼2.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention: You can look at the official readme.txt

previewoneditor/mch-preview-on-editor.php 85% from 13 tests

The main PHP script in "PreviewOnEditor" version 0.0.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("previewoneditor.php" instead of "mch-preview-on-editor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected225 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP26640124
CSS2361071
JavaScript40030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods872.73%
▷ Protected methods00.00%
▷ Private methods327.27%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected