84% just-post-preview

Code Review | Just Post Preview Widget

WordPress plugin Just Post Preview Widget scored84%from 54 tests.

About plugin

  • Plugin page: just-post-preview
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2015
  • Latest release: Mar 6, 2017
  • Number of updates: 14
  • Update frequency: every 55.0 days
  • Top authors: aprokopenko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,648 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.04MB] [CPU: ▼7.70ms] Passed 4 tests

An overview of server-side resources used by Just Post Preview Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.66 ▼1.37
Dashboard /wp-admin3.36 ▲0.0142.55 ▼14.70
Posts /wp-admin/edit.php3.41 ▲0.0546.90 ▼1.19
Add New Post /wp-admin/post-new.php5.96 ▲0.0782.40 ▼13.55
Media Library /wp-admin/upload.php3.28 ▲0.0535.85 ▼1.19

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_jpp_widget_post_preview
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Just Post Preview Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.42 ▲0.041.76 ▲0.1843.28 ▲1.47
Dashboard /wp-admin2,192 ▲125.56 ▼0.1086.30 ▼1.1439.93 ▼0.41
Posts /wp-admin/edit.php2,103 ▼02.00 ▼0.0334.87 ▼6.5335.08 ▼2.66
Add New Post /wp-admin/post-new.php1,534 ▲823.35 ▲0.15675.49 ▲11.3857.27 ▲3.05
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.06110.30 ▲6.5849.23 ▲1.14

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_jpp_widget_post_preview
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/just-post-preview/layouts/jpp_layout_hero.php on line 7
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/just-post-preview/layouts/jpp_layout_left_image.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/just-post-preview/just-post-preview.widget.php:10
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/just-post-preview/just-post-preview.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_post_thumbnail() in wp-content/plugins/just-post-preview/layouts/jpp_layout_left_image.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_post_thumbnail() in wp-content/plugins/just-post-preview/layouts/jpp_layout_right_image.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/just-post-preview/just-post-preview.widget.php:10
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/just-post-preview/layouts/jpp_layout_hero.php on line 7
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/just-post-preview/layouts/jpp_layout_left_image.php on line 7
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/just-post-preview/layouts/jpp_layout_right_image.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Widget edit screenshot), #2 (Using widget inside the SiteOrigin Page builder plugin)
You can take inspiration from this readme.txt

just-post-preview/just-post-preview.php Passed 13 tests

"Just Post Preview Widget" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
92 characters long description:
Widget to easy add any content preview block with different layouts, specified in the theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin308 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP54782258
JavaScript17147
CSS1003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods333.33%
▷ Public methods666.67%
▷ Protected methods333.33%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png23.08KB9.14KB▼ 60.39%
screenshot-2.png43.81KB18.52KB▼ 57.73%