78% gantry5

Code Review | Gantry 5 Framework

WordPress plugin Gantry 5 Framework scored78%from 54 tests.

About plugin

  • Plugin page: gantry5
  • Plugin version: 5.5.17
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 1, 2015
  • Latest release: Oct 30, 2023
  • Number of updates: 251
  • Update frequency: every 11.9 days
  • Top authors: gantry (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

10,000+ active /284,468 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼12.32ms] Passed 4 tests

A check of server-side resources used by Gantry 5 Framework
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0145.19 ▲9.90
Dashboard /wp-admin3.54 ▲0.2452.33 ▼8.88
Posts /wp-admin/edit.php3.66 ▲0.3045.99 ▼28.82
Add New Post /wp-admin/post-new.php6.13 ▲0.2385.16 ▼13.04
Media Library /wp-admin/upload.php3.47 ▲0.2334.34 ▲1.46
Gantry 5 Settings /wp-admin/options-general.php?page=g5-settings3.4331.75

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,997 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
gantry5_plugin
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Gantry 5 Framework: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.31 ▼0.162.59 ▲0.9251.67 ▲8.50
Dashboard /wp-admin2,199 ▲255.57 ▼0.0981.91 ▼38.4536.35 ▼15.12
Posts /wp-admin/edit.php2,104 ▲11.97 ▲0.0233.73 ▼8.5234.71 ▼2.36
Add New Post /wp-admin/post-new.php1,538 ▲1218.31 ▼4.72647.70 ▼41.9361.06 ▲11.66
Media Library /wp-admin/upload.php1,404 ▲74.27 ▲0.0795.50 ▼5.1144.15 ▼1.71
Gantry 5 Settings /wp-admin/options-general.php?page=g5-settings1,0252.0423.4027.20

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gantry5/vendor/filp/whoops/src/Whoops/Resources/views/frames_description.html.php
    • > /wp-content/plugins/gantry5/vendor/filp/whoops/src/Whoops/Resources/views/env_details.html.php
    • > /wp-content/plugins/gantry5/vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php
    • > /wp-content/plugins/gantry5/vendor/filp/whoops/src/Whoops/Resources/views/header.html.php
  • 766× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gantry5/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\Loader\\LoaderInterface' not found in wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Loader/ChainLoader.php:24
    • > PHP Fatal error
      Trait 'Gantry\\Component\\Gantry\\GantryTrait' not found in wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Widgets.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gantry5/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Gantry\\Component\\Admin\\HtmlController' not found in wp-content/plugins/gantry5/src/classes/Gantry/Admin/Controller/Html/About.php:24
    • > PHP Warning
      implode(): Invalid arguments passed in wp-content/plugins/gantry5/vendor/filp/whoops/src/Whoops/Resources/views/header.html.php on line 53
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gantry5/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/gantry5/vendor/twig/twig/src/TokenParser/FilterTokenParser.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/gantry5/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

gantry5/gantry5.php Passed 13 tests

The primary PHP file in "Gantry 5 Framework" version 5.5.17 is used by WordPress to initiate all plugin functionality
36 characters long description:
Framework for Gantry 5 based themes.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin127,867 lines of code in 1,496 files:
LanguageFilesBlank linesComment linesLines of code
PHP99623,44242,89486,439
SVG1011213,983
Sass1981,9361,08910,141
Twig1824651725,672
CSS132,0671332,992
JSON25302,796
YAML5235232,556
JavaScript103129622,456
PO File22850602
reStructuredText2105144110
Markdown433098
XML23522

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,498)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 199)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity13.32
▷ Minimum class complexity1.00
▷ Maximum class complexity1,498.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity199.00
Code structure
Namespaces132
Interfaces93
Traits16
Classes1,279
▷ Abstract classes634.93%
▷ Concrete classes1,21695.07%
▷ Final classes201.64%
Methods6,531
▷ Static methods5979.14%
▷ Public methods4,41167.54%
▷ Protected methods1,85428.39%
▷ Private methods2664.07%
Functions451
▷ Named functions18140.13%
▷ Anonymous functions27059.87%
Constants409
▷ Global constants204.89%
▷ Class constants38995.11%
▷ Public constants38799.49%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/layouts/3-col-right.png0.30KB0.33KB0.00%
admin/images/layouts/3-col-left.png0.29KB0.31KB0.00%
admin/images/layouts/offline.png2.18KB2.35KB0.00%
admin/images/layouts/body-only.png0.24KB0.24KB0.00%
admin/images/layouts/default.png0.25KB0.26KB0.00%