83% rewards4earth-connector

Code Review | R4E Cart

WordPress plugin R4E Cart scored 83% from 54 tests.

About plugin

  • Plugin page: rewards4earth-con...
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.1-6.1.1
  • WordPress version: 6.3.1
  • First release: May 27, 2021
  • Latest release: Dec 6, 2022
  • Number of updates: 11
  • Update frequency: every 50.9 days
  • Top authors: rewards4earth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.86ms] Passed 4 tests

This is a short check of server-side resources used by R4E Cart
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.64 ▼7.50
Dashboard /wp-admin3.36 ▲0.0645.55 ▼6.48
Posts /wp-admin/edit.php3.41 ▲0.0649.93 ▲3.37
Add New Post /wp-admin/post-new.php5.94 ▲0.0694.95 ▼4.35
Media Library /wp-admin/upload.php3.28 ▲0.0634.34 ▼1.09

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
r4earth_biz_email
widget_recent-comments
r4earth_biz_token
db_upgraded
r4earth_biz_id
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for R4E Cart
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.30 ▼1.091.86 ▲0.0341.72 ▼3.49
Dashboard /wp-admin2,222 ▲455.89 ▲0.03107.92 ▼2.8241.54 ▼1.96
Posts /wp-admin/edit.php2,105 ▲162.04 ▲0.0239.65 ▲4.1235.50 ▲3.43
Add New Post /wp-admin/post-new.php1,545 ▲3123.40 ▲5.86582.03 ▼85.6149.84 ▼11.18
Media Library /wp-admin/upload.php1,407 ▲224.22 ▲0.0197.35 ▼4.9441.10 ▼3.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rewards4earth-connector/public/checkoutpage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rewards4earth-connector/admin/adminpage.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rewards4earth-connector/r4ecart.php:22

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

rewards4earth-connector/r4ecart.php 69% from 13 tests

"R4E Cart" version 1.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("rewards4earth-connector.php" instead of "r4ecart.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 316 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin617 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript412542331
PHP313530285
CSS1061

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin