78% ghost

Code Review | Ghost

WordPress plugin Ghost scored78%from 54 tests.

About plugin

  • Plugin page: ghost
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2013
  • Latest release: Nov 13, 2023
  • Number of updates: 70
  • Update frequency: every 57.4 days
  • Top authors: javorszky (41.43%)nathanjeffery (28.57%)pauladamdavis (24.29%)JohnONolan (10%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /32,143 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.09MB] [CPU: ▼3.33ms] Passed 4 tests

This is a short check of server-side resources used by Ghost
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.21 ▼1.79
Dashboard /wp-admin3.40 ▲0.0947.34 ▼4.86
Posts /wp-admin/edit.php3.51 ▲0.1545.16 ▼0.48
Add New Post /wp-admin/post-new.php5.98 ▲0.0982.33 ▼6.19
Media Library /wp-admin/upload.php3.32 ▲0.0935.61 ▲1.25
Export to Ghost /wp-admin/tools.php?page=ghost3.2935.19

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Ghost
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.07 ▼0.281.78 ▲0.0640.23 ▼5.65
Dashboard /wp-admin2,199 ▲195.62 ▲0.0289.81 ▼3.4739.37 ▼0.20
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0135.27 ▼4.3934.07 ▼2.17
Add New Post /wp-admin/post-new.php1,529 ▼723.17 ▼0.02598.14 ▼100.2850.99 ▼3.68
Media Library /wp-admin/upload.php1,404 ▲44.21 ▼0.0098.67 ▼8.9241.07 ▼4.74
Export to Ghost /wp-admin/tools.php?page=ghost9062.0926.1538.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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× PHP files output text when accessed directly:
    • > /wp-content/plugins/ghost/views/public.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ghost/views/admin.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: export, publishing, ghost, migrate, blogging

ghost/ghost.php 92% from 13 tests

The principal PHP file in "Ghost" v. 1.4.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected500 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7127301462
CSS25238
JavaScript1010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity51.00
▷ Minimum class complexity51.00
▷ Maximum class complexity51.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods30
▷ Static methods310.00%
▷ Public methods1756.67%
▷ Protected methods00.00%
▷ Private methods1343.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.55MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png33.40KB15.33KB▼ 54.09%
assets/banner-772x250.png12.36KB5.78KB▼ 53.22%
assets/icon-256x256.png77.53KB32.36KB▼ 58.26%
assets/logo.png199.72KB67.29KB▼ 66.31%
assets/icon-128x128.png23.64KB10.69KB▼ 54.77%