10% avirato-hotels-promotional-packs

Code Review | Avirato Hotels Promotional Packs

WordPress plugin Avirato Hotels Promotional Packs scored 10% from 54 tests.

About plugin

  • Plugin page: avirato-hotels-pr...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.1
  • WordPress version: 5.8.1
  • First release: Feb 8, 2019
  • Latest release: Apr 20, 2021
  • Number of updates: 35
  • Update frequency: every 22.9 days
  • Top authors: avirato (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 868 total downloads

Benchmarks

Plugin footprint 58% 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
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+26
    Use of undefined constant AHOP_POST_NAME - assumed 'AHOP_POST_NAME' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.59MB] [CPU: ▼188.48ms] Passed 4 tests

An overview of server-side resources used by Avirato Hotels Promotional Packs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼0.686.06 ▼18.08
Dashboard /wp-admin2.06 ▼0.9910.25 ▼38.42
Posts /wp-admin/edit.php2.06 ▼1.047.67 ▼43.17
Add New Post /wp-admin/post-new.php2.06 ▼3.375.87 ▼646.70
Media Library /wp-admin/upload.php2.06 ▼0.946.29 ▼25.63
Avirato Promo Packs /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings2.067.60
Avirato Suite /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings2.066.20

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 21 new files
Database: 2 new tables, no new options
New tables
wp_ahop_cats_offerPacks
wp_ahop_textComp_offerPacks

Browser metrics Passed 4 tests

This is an overview of browser requirements for Avirato Hotels Promotional Packs
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,840 ▲24416.38 ▲0.8214.54 ▲4.5245.99 ▼7.41
Dashboard /wp-admin2,999 ▲715.88 ▼0.10141.61 ▼27.36150.40 ▲25.28
Posts /wp-admin/edit.php2,791 ▲522.68 ▼0.0162.98 ▼13.3782.51 ▼20.25
Add New Post /wp-admin/post-new.php1,719 ▲13818.83 ▼0.12370.17 ▼69.21105.41 ▼9.67
Media Library /wp-admin/upload.php1,785 ▼255.00 ▼0.03129.11 ▼39.77152.86 ▲23.47
Avirato Promo Packs /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings1,4372.4755.3597.50
Avirato Suite /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings1,2442.0854.2185.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+26
    Use of undefined constant AHOP_POST_NAME - assumed 'AHOP_POST_NAME' (this will throw an Error in a future version of PHP)

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+26
    Use of undefined constant AHOP_POST_NAME - assumed 'AHOP_POST_NAME' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+27
    Use of undefined constant AHOP_POST_TYPE - assumed 'AHOP_POST_TYPE' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+28
    Use of undefined constant AHOP_POST_CATEGORY - assumed 'AHOP_POST_CATEGORY' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+29
    Use of undefined constant AHOP_POST_AUTH_ID - assumed 'AHOP_POST_AUTH_ID' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ahs_aviratoSuite-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+30
    Use of undefined constant AHOP_POST_STATUS - assumed 'AHOP_POST_STATUS' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings
    • > Notice in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+591
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings
    • > Notice in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+593
    Trying to get property 'textoCompleto' of non-object
    • > GET request to /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings
    • > Warning in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+463
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=ahop_aviratoOfferPacks-content-settings
    • > Notice in wp-content/plugins/avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php+480
    Undefined variable: alertTrans

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

avirato-hotels-promotional-packs/Avirato_Hotels_Promotional_Packs.php 92% from 13 tests

The principal PHP file in "Avirato Hotels Promotional Packs" v. 2.0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("avirato-hotels-promotional-packs.php" instead of "Avirato_Hotels_Promotional_Packs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,951 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
CSS56588954
PHP16824770
JavaScript43537227

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/icons/ic_event_black_24dp_2x.png0.18KB0.26KB0.00%
includes/icons/avirato-logo1.png4.40KB2.39KB▼ 45.71%
includes/icons/icon-18x18.png0.53KB0.52KB▼ 0.92%
includes/icons/icon-128x128.png3.73KB2.41KB▼ 35.32%
includes/icons/icono-WEBINARS-PROXIMOS.png1.63KB1.66KB0.00%