84% gantry

Code Review | Gantry 4 Framework

WordPress plugin Gantry 4 Framework scored84%from 54 tests.

About plugin

  • Plugin page: gantry
  • Plugin version: 4.1.21
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.4.0
  • WordPress version: 6.3.1
  • First release: Sep 20, 2011
  • Latest release: Apr 2, 2020
  • Number of updates: 135
  • Update frequency: every 23.1 days
  • Top authors: gantry (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

4,000+ active /316,835 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.94ms] Passed 4 tests

An overview of server-side resources used by Gantry 4 Framework
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.14 ▼9.14
Dashboard /wp-admin3.31 ▲0.0150.39 ▲0.08
Posts /wp-admin/edit.php3.36 ▲0.0150.36 ▼2.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.71 ▼7.79
Media Library /wp-admin/upload.php3.24 ▲0.0137.18 ▲1.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 682 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Gantry 4 Framework
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.57 ▼0.972.07 ▲0.3639.52 ▼2.57
Dashboard /wp-admin2,203 ▲215.90 ▲0.09104.84 ▼1.4541.06 ▲1.95
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0539.74 ▲2.6535.29 ▲0.04
Add New Post /wp-admin/post-new.php1,528 ▼223.35 ▲0.15662.23 ▼35.9858.97 ▼1.16
Media Library /wp-admin/upload.php1,391 ▲34.16 ▼0.0896.61 ▼9.7047.94 ▲4.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 42× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: form in wp-content/plugins/gantry/admin/admin_presets.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Gantry_FileResolver' not found in wp-content/plugins/gantry/classes/Gantry/CssFileResolver.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_import() in wp-content/plugins/gantry/core/rules/facttypes/wpmllang.class.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_import() in wp-content/plugins/gantry/core/rules/gantryoverridefact.class.php:9
    • > PHP Notice
      Undefined variable: activePanel in wp-content/plugins/gantry/admin/admin_assignments.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_dirname() in wp-content/plugins/gantry/admin/override.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function getFullFieldset() on null in wp-content/plugins/gantry/admin/admin_presets.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_import() in wp-content/plugins/gantry/core/gantrycommentstempllayout.class.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_import() in wp-content/plugins/gantry/core/rules/facttypes/post_type.class.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gantry_import() in wp-content/plugins/gantry/core/rules/facttypes/menu.class.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

gantry/gantry.php Passed 13 tests

"Gantry 4 Framework" version 4.1.21's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
81 characters long description:
This is a Framework to support easily modifiable themes that are very extensible.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected68,533 lines of code in 480 files:
LanguageFilesBlank linesComment linesLines of code
PHP2666,00113,28629,752
JavaScript955,5863,69318,808
LESS671,3181,0658,491
JSON1007,555
CSS232402121,620
SVG3001,432
PO File125428563
XML20114304
HTML4008

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.80
▷ Minimum class complexity1.00
▷ Maximum class complexity589.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces8
Traits0
Classes259
▷ Abstract classes145.41%
▷ Concrete classes24594.59%
▷ Final classes10.41%
Methods1,709
▷ Static methods24514.34%
▷ Public methods1,35779.40%
▷ Protected methods32819.19%
▷ Private methods241.40%
Functions148
▷ Named functions12886.49%
▷ Anonymous functions2013.51%
Constants91
▷ Global constants4953.85%
▷ Class constants4246.15%
▷ Public constants42100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
98 PNG files occupy 0.16MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/widgets/checkbox/images/checkbox-small.png0.70KB0.43KB▼ 38.13%
admin/widgets/colorchooser/images/picker.png0.54KB0.37KB▼ 31.53%
admin/widgets/images/information.png2.24KB1.67KB▼ 25.54%
admin/widgets/preset/images/delete.png0.61KB0.58KB▼ 5.76%
admin/widgets/images/google_favicon.png1.20KB1.00KB▼ 17.01%