10% demomentsomtres-accommodation

Code Review | DeMomentSomTres Acommodation

WordPress plugin DeMomentSomTres Acommodation scored 10% from 54 tests.

About plugin

  • Plugin page: demomentsomtres-a...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2014
  • Latest release: Jan 13, 2015
  • Number of updates: 8
  • Update frequency: every 45.5 days
  • Top authors: marcqueralt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,358 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-class.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; DeMomentSomTresAccommodation has a deprecated constructor

Server metrics [RAM: ▼1.87MB] [CPU: ▼55.07ms] Passed 4 tests

Server-side resources used by DeMomentSomTres Acommodation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.355.56 ▼37.73
Dashboard /wp-admin2.13 ▼1.175.60 ▼52.18
Posts /wp-admin/edit.php2.13 ▼1.227.03 ▼41.29
Add New Post /wp-admin/post-new.php2.13 ▼3.755.70 ▼89.09
Media Library /wp-admin/upload.php2.13 ▼1.105.91 ▼30.79
Accommodation Types /wp-admin/edit-tags.php?taxonomy=accommodation-type&post_type=accommodation-item2.145.70
Accommodation Items /wp-admin/edit.php?post_type=accommodation-item2.146.10
Accommodation /wp-admin/options-general.php?page=dmst_accommodation2.137.11
Add Accommodation Item /wp-admin/post-new.php?post_type=accommodation-item2.135.38

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_otheraccommodationswidget
widget_recent-comments
widget_accommodationserviceswidget
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by DeMomentSomTres Acommodation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10314.48 ▲0.081.83 ▲0.0742.68 ▼7.64
Dashboard /wp-admin2,241 ▲534.82 ▼0.05107.80 ▼9.1441.43 ▼8.10
Posts /wp-admin/edit.php2,127 ▲382.02 ▼0.0139.61 ▲3.2138.43 ▲5.16
Add New Post /wp-admin/post-new.php1,571 ▲3718.26 ▼4.90595.33 ▼36.5551.09 ▼2.13
Media Library /wp-admin/upload.php1,420 ▲354.21 ▼0.0094.59 ▼7.4942.24 ▼3.90
Accommodation Types /wp-admin/edit-tags.php?taxonomy=accommodation-type&post_type=accommodation-item1,2692.1425.9227.54
Accommodation Items /wp-admin/edit.php?post_type=accommodation-item1,1441.9930.0431.04
Accommodation /wp-admin/options-general.php?page=dmst_accommodation9682.0725.9433.97
Add Accommodation Item /wp-admin/post-new.php?post_type=accommodation-item2,8867.87172.7978.85

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
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-class.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; DeMomentSomTresAccommodation has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_accommodationserviceswidget
    • widget_otheraccommodationswidget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-class.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; DeMomentSomTresAccommodation has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-widgets.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; OtherAccommodationsWidget has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-widgets.php+101
    Methods with the same name as their class will not be constructors in a future version of PHP; AccommodationServicesWidget has a deprecated constructor
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Deprecated in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-class.php+17
    Function create_function() is deprecated
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in OtherAccommodationsWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in AccommodationServicesWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Warning in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-admin.php+14
    Use of undefined constant DMST_PORTFOLIO_TEXT_DOMAIN - assumed 'DMST_PORTFOLIO_TEXT_DOMAIN' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=dmst_accommodation
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=dmst_accommodation
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/post-new.php?post_type=accommodation-item
    • > Notice in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-class.php+253
    Undefined index: dms3-accommodation-services

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-accommodation.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-admin.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/demomentsomtres-accommodation/demomentsomtres-widgets.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: multisite, acommodation, availability

demomentsomtres-accommodation/demomentsomtres-accommodation.php Passed 13 tests

The primary PHP file in "DeMomentSomTres Acommodation" version 1.2.2 is used by WordPress to initiate all plugin functionality
24 characters long description:
Accommodation management

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
Everything looks great! No dangerous files found in this plugin567 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP671191567

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity10.33
▷ Minimum class complexity8.00
▷ Maximum class complexity14.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin