78% caxton

Code Review | Caxton - Create Pro page layouts in Gutenberg

WordPress plugin Caxton - Create Pro page layouts in Gutenberg scored 78% from 53 tests.

About plugin

  • Plugin page: caxton
  • Plugin version: 1.27.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.7.0
  • WordPress version: 5.8.1
  • First release: Jan 22, 2018
  • Latest release: Mar 8, 2021
  • Number of updates: 57
  • Update frequency: every 20.0 days
  • Top authors: shramee (100%)

Code review

53 tests

User reviews

16 reviews

Install metrics

4,000+ active / 43,730 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
Installer ran successfully

Server metrics [RAM: ▲4.44MB] [CPU: ▼253.79ms] Passed 4 tests

A check of server-side resources used by Caxton - Create Pro page layouts in Gutenberg
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /7.95 ▲5.2351.98 ▲30.37
Dashboard /wp-admin7.97 ▲4.9165.77 ▲22.81
Posts /wp-admin/edit.php7.97 ▲4.8662.71 ▲19.07
Add New Post /wp-admin/post-new.php8.44 ▲3.0179.65 ▼1,070.85
Media Library /wp-admin/upload.php7.97 ▲4.9653.80 ▲13.83
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius7.9748.87

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 279 new files
Database: no new tables, 5 new options
New WordPress options
fs_gdpr
fs_api_cache
fs_accounts
fs_debug_mode
fs_active_plugins

Browser metrics Passed 4 tests

An overview of browser requirements for Caxton - Create Pro page layouts in Gutenberg
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,762 ▲15615.91 ▲0.497.52 ▼2.4445.04 ▼2.73
Dashboard /wp-admin3,010 ▲1575.91 ▲0.08128.57 ▼4.80120.44 ▲20.84
Posts /wp-admin/edit.php2,757 ▲512.70 ▲0.0258.11 ▼4.1294.87 ▼1.50
Add New Post /wp-admin/post-new.php1,898 ▲4518.24 ▼0.89378.60 ▲8.73112.90 ▲6.77
Media Library /wp-admin/upload.php1,749 ▼235.00 ▼0.01132.91 ▼12.74109.36 ▼10.55
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,4852.0956.3971.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • fs_gdpr
    • fs_debug_mode
    • fs_active_plugins
    • fs_api_cache
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/caxton/inc/wp-sdk/templates/ajax-loader.php
    • > /wp-content/plugins/caxton/inc/tpl.caxton-admin-page.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/caxton/inc/wp-sdk/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caxton/caxton.php:29
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/caxton/inc/wp-sdk/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/caxton/inc/tpl.caxton-admin-disable-blocks.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: blocks, posts grid, gutenberg blocks, gutenberg

caxton/caxton.php Passed 13 tests

This is the main PHP file of "Caxton - Create Pro page layouts in Gutenberg" version 1.27.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
29 characters long description:
Caxton - blocks for Gutenberg

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin57,544 lines of code in 231 files:
LanguageFilesBlank linesComment linesLines of code
PHP1116,78515,39929,102
PO File105,7106,91312,558
Sass702,74714210,472
JavaScript214541595,039
JSON200332
CSS160422
SVG10019

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity78.48
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,111
▷ Static methods17515.75%
▷ Public methods77169.40%
▷ Protected methods161.44%
▷ Private methods32429.16%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants120
▷ Global constants9780.83%
▷ Class constants2319.17%
▷ Public constants23100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/wp-sdk/assets/img/caxton.png9.16KB5.26KB▼ 42.58%
inc/wp-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
inc/wp-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%