72% recras

Code Review | Recras WordPress plugin

WordPress plugin Recras WordPress plugin scored72%from 54 tests.

About plugin

  • Plugin page: recras
  • Plugin version: 6.0.1
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Oct 27, 2015
  • Latest release: Nov 27, 2023
  • Number of updates: 456
  • Update frequency: every 6.5 days
  • Top authors: ZanderZ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /17,867 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: ▲0.53MB] [CPU: ▼4.30ms] Passed 4 tests

This is a short check of server-side resources used by Recras WordPress plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4038.78 ▼9.26
Dashboard /wp-admin3.91 ▲0.5754.46 ▼6.55
Posts /wp-admin/edit.php3.97 ▲0.6150.12 ▲1.02
Add New Post /wp-admin/post-new.php6.50 ▲0.6197.43 ▼2.40
Media Library /wp-admin/upload.php3.78 ▲0.5539.99 ▲4.50
/wp-admin/admin.php?page=form-booking3.97462.75
Shortcodes /wp-admin/admin.php?page=recras-shortcodes3.7534.80
/wp-admin/admin.php?page=form-contact3.98423.79
Cache /wp-admin/admin.php?page=recras-clear-cache3.7436.02
/wp-admin/admin.php?page=form-arrangement3.9135.92
/wp-admin/admin.php?page=form-voucher-info3.75256.37
/wp-admin/admin.php?page=form-bookprocess3.79357.21
Documentation /wp-admin/admin.php?page=recras-documentation3.7735.73
/wp-admin/admin.php?page=form-product3.88386.13
Settings /wp-admin/admin.php?page=recras3.7536.88

Server storage [IO: ▲1.37MB] [DB: ▲0.08MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recras WordPress plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲21315.27 ▲1.0021.48 ▲19.5836.57 ▼7.02
Dashboard /wp-admin2,256 ▲795.46 ▼0.07111.39 ▲14.0269.94 ▲21.95
Posts /wp-admin/edit.php2,182 ▲852.66 ▲0.6350.63 ▲10.8132.23 ▼0.40
Add New Post /wp-admin/post-new.php6,270 ▲4,73526.69 ▲1.691,014.23 ▲362.3539.40 ▼23.80
Media Library /wp-admin/upload.php1,464 ▲645.05 ▲0.72104.27 ▲7.8977.52 ▲36.92
/wp-admin/admin.php?page=form-booking1,0832.3939.3324.94
Shortcodes /wp-admin/admin.php?page=recras-shortcodes1,4592.4340.0433.22
/wp-admin/admin.php?page=form-contact7581.518.9514.80
Cache /wp-admin/admin.php?page=recras-clear-cache8692.2637.9227.28
/wp-admin/admin.php?page=form-arrangement9922.2637.5122.55
/wp-admin/admin.php?page=form-voucher-info9252.2838.6424.94
/wp-admin/admin.php?page=form-bookprocess9622.2536.6224.91
Documentation /wp-admin/admin.php?page=recras-documentation1,2992.2439.9439.42
/wp-admin/admin.php?page=form-product1,0212.3438.5624.17
Settings /wp-admin/admin.php?page=recras9792.2636.6927.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=form-contact
    • > Error in wp-content/plugins/recras/editor/form-contact.php+22
    Uncaught Error: Object of class stdClass could not be converted to string in wp-content/plugins/recras/editor/form-contact.php:22
    Stack trace:
    #0 wp-content/plugins/recras/src/ContactForm.php(711): require_once()
    #1 wp-includes/class-wp-hook.php(310): Recras\ContactForm::showForm()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form-contact
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/recras/recras-wordpress-plugin.php
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Recras\\WordPressUnitTestCase' not found in wp-content/plugins/recras/tests/test-contact-form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/recras/editor/form-voucher-info.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/recras/editor/form-voucher-sales.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/recras/editor/form-arrangement.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/recras/src/admin/cache.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/recras/tests/test-recras-wordpress-plugin.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Recras\\WordPressUnitTestCase' not found in wp-content/plugins/recras/tests/test-arrangement.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Recras\\WordPressUnitTestCase' not found in wp-content/plugins/recras/tests/test-booking.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/recras/src/admin/documentation.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/recras/src/admin/settings.php:1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: voucher, recras, reservation, recreation, booking

recras/recras-wordpress-plugin.php 92% from 13 tests

"Recras WordPress plugin" version 6.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("recras.php" instead of "recras-wordpress-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected20,448 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript161,024578,058
PHP601,1562,1837,241
PO File81,4571,9813,125
CSS1211055790
Markdown32400656
JSON600272
Bourne Shell25137266
SVG100020
XML20020

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity19.44
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes39
▷ Abstract classes00.00%
▷ Concrete classes39100.00%
▷ Final classes00.00%
Methods335
▷ Static methods11233.43%
▷ Public methods28585.07%
▷ Protected methods236.87%
▷ Private methods278.06%
Functions9
▷ Named functions444.44%
▷ Anonymous functions555.56%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants1568.18%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.34MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png90.21KB34.95KB▼ 61.26%
assets/banner-772x250.png0.99KB0.12KB▼ 88.31%
assets/screenshot-3.png33.28KB20.27KB▼ 39.10%
assets/icon-256x256.png6.28KB6.57KB0.00%
images/timepicker_native.png9.57KB6.14KB▼ 35.83%