84% sofcar-for-wp

Code Review | Sofcar for WP

WordPress plugin Sofcar for WP scored84%from 54 tests.

About plugin

  • Plugin page: sofcar-for-wp
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-5.6
  • WordPress version: 6.3.1
  • First release: May 27, 2020
  • Latest release: Jan 9, 2021
  • Number of updates: 5
  • Update frequency: every 45.4 days
  • Top authors: sofcar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /1,743 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
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲0.85ms] Passed 4 tests

Server-side resources used by Sofcar for WP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3141.37 ▲2.70
Dashboard /wp-admin3.61 ▲0.3146.84 ▲1.94
Posts /wp-admin/edit.php3.67 ▲0.3145.66 ▼1.24
Add New Post /wp-admin/post-new.php6.16 ▲0.2787.36 ▼0.01
Media Library /wp-admin/upload.php3.48 ▲0.2545.01 ▲8.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
category_children
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Sofcar for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲18113.99 ▼0.378.40 ▲6.5947.68 ▲6.10
Dashboard /wp-admin2,228 ▲405.87 ▲0.97104.10 ▼0.4099.10 ▲58.24
Posts /wp-admin/edit.php2,165 ▲792.04 ▲0.0035.67 ▼2.5742.06 ▲8.80
Add New Post /wp-admin/post-new.php1,702 ▲18822.52 ▲5.02775.97 ▲82.3943.56 ▼9.19
Media Library /wp-admin/upload.php1,419 ▲344.21 ▲0.01101.02 ▲2.0780.37 ▲38.65

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • category_children
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sofcar-for-wp/public/inc/sofcar-shortcode.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/sofcar-for-wp/admin/partials/sofcar-dashboard.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: onlien booking engine, sofcar, rent a car, car rental software, free fleet management

sofcar-for-wp/sofcar.php 85% from 13 tests

This is the main PHP file of "Sofcar for WP" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sofcar-for-wp.php" instead of "sofcar.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected2,367 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP145124311,661
PO File1141180372
CSS2966322
JavaScript23512

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity27.38
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods74
▷ Static methods34.05%
▷ Public methods5371.62%
▷ Protected methods00.00%
▷ Private methods2128.38%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.30MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon/place.png14.21KB7.34KB▼ 48.35%
images/brand/sofcar_wordpress.png3.78KB1.88KB▼ 50.31%
images/brand/bg.png140.06KB83.58KB▼ 40.33%
images/icon/sofcar_icon_16x16.png1.11KB0.30KB▼ 73.16%
images/brand/help-person-min.png52.05KB17.72KB▼ 65.95%