10% chaletagent

Code Review | Chalet Agent

WordPress plugin Chalet Agent scored 10% from 54 tests.

About plugin

  • Plugin page: chaletagent
  • Plugin version: 0.2.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 5.8.1
  • First release: Jul 17, 2015
  • Latest release: Mar 17, 2020
  • Number of updates: 31
  • Update frequency: every 55.1 days
  • Top authors: ChaletAgent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 729 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/chaletagent/class/main.php+32
    Undefined index: page

Server metrics [RAM: ▼1.82MB] [CPU: ▼189.32ms] Passed 4 tests

This is a short check of server-side resources used by Chalet Agent
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.81 ▼0.915.13 ▼14.77
Dashboard /wp-admin1.83 ▼1.235.56 ▼40.10
Posts /wp-admin/edit.php1.83 ▼1.286.08 ▼43.92
Add New Post /wp-admin/post-new.php1.83 ▼3.605.70 ▼634.04
Media Library /wp-admin/upload.php1.83 ▼1.184.97 ▼39.22
ChaletAgent /wp-admin/options-general.php?page=chaletagent-options3.0223.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
chaletagent_saas_account

Browser metrics Passed 4 tests

This is an overview of browser requirements for Chalet Agent
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,698 ▲10215.86 ▼0.099.00 ▼1.0147.60 ▼3.46
Dashboard /wp-admin2,987 ▲505.95 ▼0.16142.86 ▼8.63104.10 ▲0.09
Posts /wp-admin/edit.php2,756 ▲172.72 ▼0.0168.22 ▲4.5685.56 ▼7.33
Add New Post /wp-admin/post-new.php1,626 ▼2,01021.39 ▲6.17296.65 ▼165.89105.00 ▼7.66
Media Library /wp-admin/upload.php1,824 ▲175.02 ▲0.01160.34 ▼4.20116.90 ▼0.87
ChaletAgent /wp-admin/options-general.php?page=chaletagent-options1,3252.0954.9794.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/chaletagent/class/main.php+32
    Undefined index: page
  • Zombie WordPress options detected upon uninstall: 1 option
    • chaletagent_saas_account

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/chaletagent/chalet-agent.php
    • > /wp-content/plugins/chaletagent/inc/help-text.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/chaletagent/inc/error-log.php:14

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

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: chalet agent, chaletagent, chalet

chaletagent/chalet-agent.php 92% from 13 tests

The main PHP file in "Chalet Agent" ver. 0.2.11 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: Name the main plugin file the same as the plugin slug ("chaletagent.php" instead of "chalet-agent.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
Everything looks great! No dangerous files found in this plugin449 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7111208376
CSS119573

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity9.00
▷ Minimum class complexity7.00
▷ Maximum class complexity11.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods29.09%
▷ Public methods1986.36%
▷ Protected methods00.00%
▷ Private methods313.64%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin