10% chalet-montagne-com-tools

Code Review | Chalet-Montagne.com Tools

WordPress plugin Chalet-Montagne.com Tools scored10%from 54 tests.

About plugin

  • Plugin page: chalet-montagne-c...
  • Plugin version: 2.6.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.0
  • WordPress version: 6.3.1
  • First release: Mar 23, 2018
  • Latest release: Jul 24, 2023
  • Number of updates: 25
  • Update frequency: every 78.0 days
  • Top authors: alpium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,190 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/chalet-montagne-com-tools/classes/chalet-montagne-admin.php+1937
    Trying to get property 'date_fin_api_wpp' of non-object

Server metrics [RAM: ▼1.23MB] [CPU: ▲460.79ms] 75% from 4 tests

This is a short check of server-side resources used by Chalet-Montagne.com Tools
It is recommended to improve the following
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 460.79ms on /wp-admin/admin.php?page=cmci-parameter-page)
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.60502.72 ▲464.76
Dashboard /wp-admin2.76 ▼0.58486.96 ▲425.92
Posts /wp-admin/edit.php2.76 ▼0.59603.82 ▲555.68
Add New Post /wp-admin/post-new.php2.76 ▼3.12491.23 ▲396.79
Media Library /wp-admin/upload.php2.76 ▼0.471,762.38 ▲1,729.92
ChaletMontagne /wp-admin/admin.php?page=cmci-page2.76475.58
Paramètrage /wp-admin/admin.php?page=cmci-parameter-page2.76484.48

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 94 new files
Database: no new tables, 8 new options
New WordPress options
cmci_date_fin_api_wpp
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
cmci_version
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Chalet-Montagne.com Tools
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲17613.81 ▼0.5812.36 ▲10.4644.08 ▼1.12
Dashboard /wp-admin2,237 ▲495.88 ▲0.85106.78 ▼12.9741.49 ▼4.25
Posts /wp-admin/edit.php2,116 ▲271.99 ▼0.0332.28 ▼3.6535.48 ▲1.75
Add New Post /wp-admin/post-new.php1,540 ▲820.95 ▼2.40680.10 ▲63.3356.96 ▲4.99
Media Library /wp-admin/upload.php1,412 ▲274.16 ▼0.0399.87 ▲1.5542.25 ▼2.45
ChaletMontagne /wp-admin/admin.php?page=cmci-page1,0851.9628.9254.71
Paramètrage /wp-admin/admin.php?page=cmci-parameter-page1,0851.9627.2838.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/chalet-montagne-com-tools/classes/chalet-montagne-admin.php+1937
    Trying to get property 'date_fin_api_wpp' of non-object
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cmci-parameter-page
    • > Notice in wp-content/plugins/chalet-montagne-com-tools/classes/chalet-montagne-admin.php+1939
    Trying to get property 'date_fin_api_wpp' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cmci-parameter-page
    • > Notice in wp-content/plugins/chalet-montagne-com-tools/classes/chalet-montagne-admin.php+1937
    Trying to get property 'date' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cmci-parameter-page
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ChaletMontagneAdmin::upgrade_plugin() should not be called statically

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
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/chalet-montagne-com-tools/views/headerConfig.admin.php
    • > /wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php
    • > /wp-content/plugins/chalet-montagne-com-tools/views/gallery.front.php
  • 94× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: prefixInput in wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php on line 59
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/chalet-montagne-com-tools/views/modal.front.php on line 1
    • > PHP Notice
      Undefined variable: startEvents in wp-content/plugins/chalet-montagne-com-tools/views/planning.front.php on line 6
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/chalet-montagne-com-tools/views/notice.admin.php on line 17
    • > PHP Notice
      Undefined variable: idModal in wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php on line 53
    • > PHP Notice
      Undefined variable: idModal in wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php on line 20
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/chalet-montagne-com-tools/views/headerConfig.admin.php on line 8
    • > PHP Notice
      Undefined variable: idModal in wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php on line 66
    • > PHP Notice
      Undefined variable: idModal in wp-content/plugins/chalet-montagne-com-tools/views/tarif.front.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/chalet-montagne-com-tools/views/planning.front.php:86

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
  • Screenshots: These screenshots require images: #1 (Ecran de validation de la clé), #2 (Liste des locations)
The official readme.txt is a good inspiration

chalet-montagne-com-tools/chalet-montagne.php 92% from 13 tests

The main file in "Chalet-Montagne.com Tools" v. 2.6.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("chalet-montagne-com-tools.php" instead of "chalet-montagne.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin20,746 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript139853,04115,241
PHP227624933,689
CSS134043561,620
LESS118112
PO File2242484

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity187.50
▷ Minimum class complexity73.00
▷ Maximum class complexity302.00
Average method complexity6.33
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods70
▷ Static methods6491.43%
▷ Public methods5274.29%
▷ Protected methods1217.14%
▷ Private methods68.57%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants931.03%
▷ Class constants2068.97%
▷ Public constants20100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 1.58MB with 0.60MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_ffffff_256x240.png3.19KB3.49KB0.00%
assets/img/Mail-icon.png0.44KB0.48KB0.00%
assets/screenshot-1.png427.61KB126.43KB▼ 70.43%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
assets/img/fond-pied-de-page.png361.68KB156.43KB▼ 56.75%