89% public-post-preview-configurator

Code Review | Public Post Preview Configurator

WordPress plugin Public Post Preview Configurator scored 89% from 53 tests.

About plugin

  • Plugin page: public-post-previ...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8.1
  • WordPress version: 5.8.1
  • First release: Dec 1, 2013
  • Latest release: Sep 23, 2021
  • Number of updates: 12
  • Update frequency: every 237.9 days
  • Top authors: bjoerne (100%)

Code review

53 tests

User reviews

3 reviews

Install metrics

8,000+ active / 22,300 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼283.40ms] Passed 4 tests

A check of server-side resources used by Public Post Preview Configurator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1346.64 ▲30.64
Dashboard /wp-admin3.09 ▲0.0436.27 ▼3.57
Posts /wp-admin/edit.php3.14 ▲0.0443.79 ▼0.82
Add New Post /wp-admin/post-new.php5.45 ▲0.0290.08 ▼1,113.93
Media Library /wp-admin/upload.php3.03 ▲0.0325.23 ▼15.28
Public Post Preview Configurator /wp-admin/options-general.php?page=public-post-preview-configurator3.0028.41

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Public Post Preview Configurator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲12515.92 ▲0.418.92 ▼0.2346.06 ▼2.83
Dashboard /wp-admin2,961 ▲1115.92 ▲0.05135.75 ▼1.88101.76 ▲2.95
Posts /wp-admin/edit.php2,708 ▲22.69 ▲0.0063.90 ▲2.9179.83 ▼8.50
Add New Post /wp-admin/post-new.php1,656 ▲518.52 ▲1.48353.55 ▼5.61102.45 ▼7.87
Media Library /wp-admin/upload.php1,783 ▲84.99 ▼0.02149.79 ▼0.41106.24 ▼10.62
Public Post Preview Configurator /wp-admin/options-general.php?page=public-post-preview-configurator1,0242.1154.4063.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=public-post-preview-configurator
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=public-post-preview-configurator
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at 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 screen_icon() in wp-content/plugins/public-post-preview-configurator/admin/views/admin.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: post, public, preview, posts, configuration

public-post-preview-configurator/public-post-preview-configurator.php Passed 13 tests

"Public Post Preview Configurator" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
76 characters long description:
Enables you to configure 'public post preview' plugin with a user interface.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin171 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP634204137
PO File161334

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.50
▷ Minimum class complexity4.00
▷ Maximum class complexity5.00
Average method complexity1.58
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

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