84% caramelopay

Code Review | CarameloPay

WordPress plugin CarameloPay scored84%from 54 tests.

About plugin

  • Plugin page: caramelopay
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: May 12, 2023
  • Latest release: Jun 13, 2023
  • Number of updates: 6
  • Update frequency: every 5.3 days
  • Top authors: caramelogag (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /334 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.00MB] [CPU: ▼12.06ms] Passed 4 tests

This is a short check of server-side resources used by CarameloPay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.43 ▼6.45
Dashboard /wp-admin3.31 ▼0.0348.53 ▼18.12
Posts /wp-admin/edit.php3.36 ▲0.0151.88 ▼0.82
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.19 ▼22.86
Media Library /wp-admin/upload.php3.23 ▲0.0136.56 ▲2.02

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for CarameloPay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.401.77 ▼0.1944.47 ▲0.75
Dashboard /wp-admin2,206 ▲185.85 ▲0.81105.62 ▼4.7042.07 ▲6.35
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0438.78 ▼0.7235.41 ▼2.34
Add New Post /wp-admin/post-new.php1,522 ▼623.11 ▼0.13646.77 ▲38.2770.64 ▲14.65
Media Library /wp-admin/upload.php1,385 ▼34.21 ▼0.0096.97 ▼14.1244.03 ▼2.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/caramelopay/view/thankyou.php on line 1
    • > PHP Notice
      Trying to get property 'status' of non-object in wp-content/plugins/caramelopay/view/thankyou.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caramelopay/include/Settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/caramelopay/CarameloPay_Credit.php:7
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/caramelopay/view/thankyou.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/caramelopay/view/options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/caramelopay/CarameloPay_Pix.php:7
    • > PHP Notice
      Trying to get property 'status' of non-object in wp-content/plugins/caramelopay/view/thankyou.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/caramelopay/view/credit_form.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: carto, pix, cartao de credito

caramelopay/index.php 92% from 13 tests

This is the main PHP file of "CarameloPay" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("caramelopay.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin666 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP913066652
CSS11014

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity22.00
▷ Minimum class complexity15.00
▷ Maximum class complexity29.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/caramelo-icon.png0.43KB0.29KB▼ 32.80%
assets/screenshot-3.png34.74KB13.78KB▼ 60.32%
assets/logo.png30.54KB17.10KB▼ 43.99%
assets/screenshot-1.png29.80KB9.60KB▼ 67.78%
assets/screenshot-2.png43.79KB14.37KB▼ 67.18%