73% gym-builder

Code Review | Gym Builder - Fitness, Gym, Class Schedule Maker Plugin

WordPress plugin Gym Builder - Fitness, Gym, Class Schedule Maker Plugin scored73%from 54 tests.

About plugin

  • Plugin page: gym-builder
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 8, 2023
  • Latest release: Oct 8, 2023
  • Number of updates: 14
  • Update frequency: every 8.7 days
  • Top authors: wpdreamers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /291 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲1.07MB] [CPU: ▲3.10ms] Passed 4 tests

A check of server-side resources used by Gym Builder - Fitness, Gym, Class Schedule Maker Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.58 ▲1.1258.78 ▲9.26
Dashboard /wp-admin4.38 ▲1.0462.15 ▼8.67
Posts /wp-admin/edit.php4.47 ▲1.1167.01 ▲17.89
Add New Post /wp-admin/post-new.php6.96 ▲1.07110.43 ▼5.10
Media Library /wp-admin/upload.php4.28 ▲1.0551.64 ▲16.91
Trainers Categories /wp-admin/edit-tags.php?taxonomy=gym_builder_trainer_category&post_type=gym_builder_trainer4.2749.65
Add New /wp-admin/post-new.php?post_type=gym_builder_class4.53103.23
Classs Categories /wp-admin/edit-tags.php?taxonomy=gym_builder_class_category&post_type=gym_builder_class4.2849.49
All Classes /wp-admin/edit.php?post_type=gym_builder_class4.3350.93
All Trainers /wp-admin/edit.php?post_type=gym_builder_trainer4.3347.14
Add New /wp-admin/post-new.php?post_type=gym_builder_trainer4.5272.13

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 118 new files
Database: no new tables, 14 new options
New WordPress options
gym_builder_class_settings
theysaidso_admin_options
widget_recent-comments
gym_builder_page_settings
db_upgraded
gym_builder_trainer_settings
gym_builder_version
widget_theysaidso_widget
widget_gym_builder_trainer_widget
widget_gym_builder_class_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Gym Builder - Fitness, Gym, Class Schedule Maker Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,006 ▲26013.79 ▼0.467.82 ▲5.8743.52 ▼5.10
Dashboard /wp-admin2,274 ▲1005.95 ▲0.3788.72 ▼0.7784.66 ▲45.19
Posts /wp-admin/edit.php2,196 ▲962.39 ▲0.4239.38 ▲1.8735.57 ▼0.87
Add New Post /wp-admin/post-new.php1,606 ▲8024.22 ▲0.41696.69 ▲50.1037.87 ▼27.19
Media Library /wp-admin/upload.php1,491 ▲944.67 ▲0.51101.12 ▲1.1064.40 ▲19.91
Trainers Categories /wp-admin/edit-tags.php?taxonomy=gym_builder_trainer_category&post_type=gym_builder_trainer1,3702.2044.2345.91
Add New /wp-admin/post-new.php?post_type=gym_builder_class2,6078.34197.38154.85
Classs Categories /wp-admin/edit-tags.php?taxonomy=gym_builder_class_category&post_type=gym_builder_class1,3762.2129.9437.84
All Classes /wp-admin/edit.php?post_type=gym_builder_class1,1932.6935.1732.43
All Trainers /wp-admin/edit.php?post_type=gym_builder_trainer1,1992.6839.5631.75
Add New /wp-admin/post-new.php?post_type=gym_builder_trainer2,5708.22178.70128.36

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_gym_builder_class_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_gym_builder_trainer_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 31× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/gym-builder/inc/Base/Install.php
    • > /wp-content/plugins/gym-builder/inc/Traits/UtilityTrait.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Admin/Models/Metabox/RegisterPostMeta.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Admin/Models/Widgets/WidgetFields.php
    • > /wp-content/plugins/gym-builder/inc/Traits/Constants.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Admin/Settings/Api/TrainerStyleSettings.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Widgets/Widgets.php
    • > /wp-content/plugins/gym-builder/inc/Traits/FileLocations.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Admin/Models/Posts/RegisterTaxonomy.php
    • > /wp-content/plugins/gym-builder/inc/Controllers/Admin/Settings/Api/TrainerSettings.php
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Trait 'GymBuilder\\Inc\\Traits\\Constants' not found in wp-content/plugins/gym-builder/inc/Controllers/Models/GymBuilderClass.php on line 12
    • > PHP Notice
      Undefined variable: is_slider_layout in wp-content/plugins/gym-builder/templates/content-class.php on line 17
    • > PHP Fatal error
      Trait 'GymBuilder\\Inc\\Traits\\Constants' not found in wp-content/plugins/gym-builder/inc/Controllers/Models/GymBuilderTrainer.php on line 11
    • > PHP Notice
      Undefined variable: layout in wp-content/plugins/gym-builder/templates/content-class.php on line 14
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/gym-builder/templates/content-class.php on line 13
    • > PHP Fatal error
      Trait 'GymBuilder\\Inc\\Traits\\Constants' not found in wp-content/plugins/gym-builder/inc/Controllers/Hooks/TemplateHooks.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gym-builder/templates/class/loop/button.php:9
    • > PHP Fatal error
      Trait 'GymBuilder\\Inc\\Traits\\FileLocations' not found in wp-content/plugins/gym-builder/inc/Controllers/Admin/Settings/Api/Callbacks/CallbackImageRadio.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/gym-builder/templates/class/layouts/layout-1.php:11
    • > PHP Fatal error
      Trait 'GymBuilder\\Inc\\Traits\\FileLocations' not found in wp-content/plugins/gym-builder/inc/Controllers/Hooks/TemplateLoader.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gym_builder_trainer
    • > 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: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/gym-builder/assets/admin/js/meta-fields.js?ver=1.0.0:102:44)\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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gym_builder_trainer
    • > 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 TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

gym-builder/gym-builder.php Passed 13 tests

This is the main PHP file of "Gym Builder - Fitness, Gym, Class Schedule Maker Plugin" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
91 characters long description:
The Best Gym Building Plugin for WordPress to Create Gym,Fitness,Body Building,Yoga Website

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
Success! There were no dangerous files found in this plugin6,629 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP829977374,803
CSS9160621,500
JavaScript74449235
XML10052
SVG19021
JSON10018

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.41
Average class complexity8.53
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces20
Interfaces0
Traits5
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes11.89%
Methods274
▷ Static methods16459.85%
▷ Public methods25894.16%
▷ Protected methods00.00%
▷ Private methods165.84%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/trainer-icon-white.png1.59KB0.92KB▼ 42.11%
assets/admin/layouts/class-layout-1.png1.50KB0.32KB▼ 78.48%
assets/admin/images/gym-builder-icon-white.png1.50KB0.72KB▼ 51.83%
assets/admin/layouts/class-layout-2.png1.33KB0.17KB▼ 86.90%
assets/admin/images/class-icon-white.png1.63KB0.95KB▼ 41.65%