78% flexi

Code Review | Flexi - Guest Submit

WordPress plugin Flexi - Guest Submit scored78%from 54 tests.

About plugin

  • Plugin page: flexi
  • Plugin version: 4.24
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 28, 2019
  • Latest release: Jun 17, 2022
  • Number of updates: 102
  • Update frequency: every 8.9 days
  • Top authors: odude (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

200+ active /10,758 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.92MB] [CPU: ▲21.79ms] Passed 4 tests

Server-side resources used by Flexi - Guest Submit
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.77 ▲2.3179.12 ▲33.42
Dashboard /wp-admin6.43 ▲3.1373.21 ▲21.62
Posts /wp-admin/edit.php6.47 ▲3.1176.24 ▲23.53
Add New Post /wp-admin/post-new.php9.18 ▲3.30106.41 ▲9.31
Media Library /wp-admin/upload.php6.35 ▲3.1265.40 ▲32.69
Settings /wp-admin/admin.php?page=flexi_settings6.3996.37
Tags /wp-admin/edit-tags.php?taxonomy=flexi_tag&post_type=flexi6.4754.04
Categories /wp-admin/edit-tags.php?taxonomy=flexi_category&post_type=flexi6.8862.02
Dashboard /wp-admin/admin.php?page=flexi6.3251.95
All Posts /wp-admin/edit.php?post_type=flexi6.4564.21

Server storage [IO: ▲11.91MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 538 new files
Database: no new tables, 29 new options
New WordPress options
widget_flexi_tag_widget
flexi_gallery_appearance_settings
flexi_pages_created
flexi_version
flexi_activated
widget_recent-comments
flexi_detail_settings
flexi_categories_settings
widget_theysaidso_widget
flexi_form_settings
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Flexi - Guest Submit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,003 ▲24216.38 ▲2.1125.29 ▲23.1841.84 ▼3.13
Dashboard /wp-admin2,254 ▲805.68 ▲0.0189.83 ▼12.5338.12 ▼5.38
Posts /wp-admin/edit.php2,167 ▲672.24 ▲0.2737.24 ▲2.3133.30 ▼2.63
Add New Post /wp-admin/post-new.php1,577 ▲4623.65 ▲0.79695.64 ▲24.2265.13 ▲10.66
Media Library /wp-admin/upload.php1,464 ▲644.37 ▲0.14105.52 ▼0.7045.35 ▲1.50
Settings /wp-admin/admin.php?page=flexi_settings8712.1327.8835.54
Tags /wp-admin/edit-tags.php?taxonomy=flexi_tag&post_type=flexi1,3232.3329.6031.16
Categories /wp-admin/edit-tags.php?taxonomy=flexi_category&post_type=flexi1,6053.2649.6227.94
Dashboard /wp-admin/admin.php?page=flexi8342.1428.9324.62
All Posts /wp-admin/edit.php?post_type=flexi1,2342.1934.2132.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 29 options in the database
    • flexi_pages_created
    • db_upgraded
    • flexi_activated
    • flexi_ffmpeg_setting
    • widget_flexi_category_widget
    • flexi_extension
    • flexi_icon_settings
    • widget_flexi_tag_widget
    • can_compress_scripts
    • flexi_gallery_appearance_settings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flexi/public/partials/layout/gallery/portfolio/header.php
    • > /wp-content/plugins/flexi/public/partials/layout/gallery/wide/header.php
    • > /wp-content/plugins/flexi/public/partials/flexi-public-display.php
    • > /wp-content/plugins/flexi/admin/partials/flexi-admin-display.php
  • 113× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/flexi/includes/addon/class-flexi-custom-field.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flexi/includes/cmb2/example-functions.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function flexi_image_data() in wp-content/plugins/flexi/public/partials/layout/gallery/basic/loop.php:2
    • > PHP Notice
      Undefined variable: count in wp-content/plugins/flexi/public/partials/layout/gallery/basic/footer.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flexi/includes/dashboard/class-flexi-dashboard-layout.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/flexi/includes/dashboard/class-flexi-dashboard-pro.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/flexi/includes/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/flexi/includes/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/flexi/public/partials/layout/gallery/wide/footer.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/flexi/includes/class-flexi_view_count.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: visitor, video gallery, gallery, frontend, photo gallery...

flexi/flexi.php Passed 13 tests

The principal PHP file in "Flexi - Guest Submit" v. 4.24 is loaded by WordPress automatically on each request
40 characters long description:
User submitted images/video into gallery

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin71,868 lines of code in 347 files:
LanguageFilesBlank linesComment linesLines of code
PO File12717,29122,63939,539
PHP1524,0938,78717,903
CSS255581,3376,787
JavaScript311,0559676,612
Markdown32440755
JSON200205
Sass55165
HTML2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity18.23
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes120
▷ Abstract classes97.50%
▷ Concrete classes11192.50%
▷ Final classes00.00%
Methods847
▷ Static methods9110.74%
▷ Public methods74788.19%
▷ Protected methods8910.51%
▷ Private methods111.30%
Functions112
▷ Named functions11098.21%
▷ Anonymous functions21.79%
Constants18
▷ Global constants1266.67%
▷ Class constants633.33%
▷ Public constants6100.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
35 PNG files occupy 4.79MB with 1.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/other.png4.04KB3.94KB▼ 2.44%
includes/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
public/images/mp4.png9.53KB9.56KB0.00%
includes/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
public/partials/layout/gallery/wide/screenshot.png245.04KB95.79KB▼ 60.91%