78% zenpost

Code Review | Zenpost

WordPress plugin Zenpost scored78%from 54 tests.

About plugin

  • Plugin page: zenpost
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.1-5.0
  • WordPress version: 6.3.1
  • First release: Jul 19, 2019
  • Latest release: Oct 14, 2019
  • Number of updates: 11
  • Update frequency: every 8.1 days
  • Top authors: zenpost (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /791 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.68MB] [CPU: ▼16.65ms] Passed 4 tests

Analyzing server-side resources used by Zenpost
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.40 ▼4.25
Dashboard /wp-admin3.32 ▲0.0143.99 ▼0.15
Posts /wp-admin/edit.php3.37 ▲0.0143.38 ▲0.04
Add New Post /wp-admin/post-new.php3.13 ▼2.7633.42 ▼62.22
Media Library /wp-admin/upload.php3.24 ▲0.0136.98 ▲3.37
Zenpost /wp-admin/options-general.php?page=zenpost3.2229.22

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
zenpost-auth-secret
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Zenpost
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲3713.19 ▼1.194.36 ▲2.3739.42 ▼5.49
Dashboard /wp-admin2,211 ▲205.79 ▲0.8994.03 ▼7.3638.79 ▲1.37
Posts /wp-admin/edit.php2,100 ▲112.04 ▲0.0441.33 ▲0.5134.78 ▼3.56
Add New Post /wp-admin/post-new.php1,521 ▼2123.08 ▲4.72664.60 ▲41.0656.15 ▼4.03
Media Library /wp-admin/upload.php1,399 ▲84.21 ▲0.02108.60 ▲15.4147.35 ▲5.08
Zenpost /wp-admin/options-general.php?page=zenpost8191.7225.5427.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • zenpost-auth-secret
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/zenpost/admin-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zenpost/class-zenpost-post-publish.php:127
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zenpost/class-zenpost-post-publish.php:127

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=zenpost
    • > Network (severe)
    wp-content/plugins/zenpost//assets/clipboard.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=zenpost
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: ClipboardJS is not defined" "ReferenceError: ClipboardJS is not defined\n at /wp-admin/options-general.php?page=zenpost:170:20\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=zenpost:195:4)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=zenpost
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: ClipboardJS is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: zenpost, publishing, social media, content delivery, blogging

zenpost/zenpost-post-api.php 85% from 13 tests

"Zenpost" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("zenpost.php" instead of "zenpost-post-api.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected697 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6135363624
JavaScript17048
JSON30025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity17.25
▷ Minimum class complexity5.00
▷ Maximum class complexity50.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1132.35%
▷ Public methods3294.12%
▷ Protected methods00.00%
▷ Private methods25.88%
Functions10
▷ Named functions220.00%
▷ Anonymous functions880.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected