78% flex-gold-for-woocommerce

Code Review | FLEX Gold

WordPress plugin FLEX Gold scored78%from 54 tests.

About plugin

  • Plugin page: flex-gold-for-woo...
  • Plugin version: 2.7.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.7.2
  • WordPress version: 6.3.1
  • First release: May 25, 2021
  • Latest release: Oct 4, 2021
  • Number of updates: 12
  • Update frequency: every 11.0 days
  • Top authors: kasiatwordpress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /564 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.42ms] Passed 4 tests

This is a short check of server-side resources used by FLEX Gold
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.61 ▼6.57
Dashboard /wp-admin3.37 ▲0.0745.63 ▼8.59
Posts /wp-admin/edit.php3.48 ▲0.1348.56 ▲1.03
Add New Post /wp-admin/post-new.php5.95 ▲0.0794.71 ▼3.55
Media Library /wp-admin/upload.php3.29 ▲0.0635.85 ▲4.31

Server storage [IO: ▲1.93MB] [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: 39 new files
Database: no new tables, 11 new options
New WordPress options
dg_capital_plugin_SHORT_NAME
db_upgraded
widget_recent-comments
dg_capital_plugin_WHAT_IS_URL
dg_capital_plugin_TERMS_URL
widget_recent-posts
dg_capital_plugin_METHOD_TITLE
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

A check of browser resources used by FLEX Gold
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.22 ▼1.154.73 ▲2.6340.35 ▼5.30
Dashboard /wp-admin2,207 ▲195.79 ▼0.10120.03 ▲14.2841.98 ▲4.03
Posts /wp-admin/edit.php2,092 ▲62.06 ▲0.0340.15 ▲4.5637.93 ▲5.39
Add New Post /wp-admin/post-new.php1,527 ▲823.37 ▲0.09667.95 ▼6.5261.22 ▲2.96
Media Library /wp-admin/upload.php1,386 ▼54.22 ▼0.0296.94 ▼0.1741.27 ▼2.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 11 options in the database
    • can_compress_scripts
    • dg_capital_plugin_ID
    • dg_capital_plugin_TERMS_URL
    • dg_capital_plugin_WHAT_IS_URL
    • theysaidso_admin_options
    • widget_recent-comments
    • dg_capital_plugin_SHORT_NAME
    • dg_capital_plugin_METHOD_TITLE
    • db_upgraded
    • widget_theysaidso_widget
    • ...

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)
Even though everything seems fine, this is not 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flex-gold-for-woocommerce/assets/partials/plugin-name-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/flex-gold-for-woocommerce/includes/class-wc-dg-capital-gateway.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: dg gold group, woocommerce, gold, flex gold, payment

flex-gold-for-woocommerce/dg-capital-plugin-for-woocommerce.php 92% from 13 tests

The main PHP file in "FLEX Gold" ver. 2.7.10 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("flex-gold-for-woocommerce.php" instead of "dg-capital-plugin-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,107 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
SVG9233,921
PHP11213763968
CSS2250115
JavaScript3120103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity23.57
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods55
▷ Static methods23.64%
▷ Public methods3970.91%
▷ Protected methods00.00%
▷ Private methods1629.09%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants13
▷ Global constants1184.62%
▷ Class constants215.38%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.51MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pmc_gold.png7.82KB3.24KB▼ 58.63%
assets/images/screenshot-1.png46.18KB19.27KB▼ 58.28%
assets/images/banner-772x250.png73.11KB24.32KB▼ 66.73%
assets/images/screenshot-2.png44.73KB16.70KB▼ 62.66%
assets/images/cards.png28.49KB11.29KB▼ 60.39%