10% trexanh-property

Code Review | TreXanh Property

WordPress plugin TreXanh Property scored 10% from 54 tests.

About plugin

  • Plugin page: trexanh-property
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-4.3
  • WordPress version: 5.8.1
  • First release: May 12, 2015
  • Latest release: Aug 20, 2015
  • Number of updates: 25
  • Update frequency: every 4.0 days
  • Top authors: trexanhlab (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,165 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/trexanh-property/modules/PluginSetup/PluginSetup.php+119
    Undefined variable: the_page

Server metrics [RAM: ▼1.14MB] [CPU: ▼180.55ms] Passed 4 tests

This is a short check of server-side resources used by TreXanh Property
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼0.5011.62 ▼25.72
Dashboard /wp-admin2.50 ▼0.5513.34 ▼31.99
Posts /wp-admin/edit.php2.51 ▼0.6012.90 ▼32.49
Add New Post /wp-admin/post-new.php2.50 ▼2.9312.87 ▼632.01
Media Library /wp-admin/upload.php2.50 ▼0.5012.95 ▼20.55
Config Property /wp-admin/admin.php?page=trexanh_property_settings&tab=trexanhproperty_property_type_setting2.5012.49
Orders /wp-admin/edit.php?post_type=property_order2.5113.56
/wp-admin/edit.php?post_type=property&page=wp-menu-separator2.5112.90
Add New House /wp-admin/post-new.php?post_type=property&property_type=house2.5112.81
Help /wp-admin/admin.php?page=trexanh_property_homepage2.5012.98
System /wp-admin/admin.php?page=trexanh_property_system2.5015.84
All Properties /wp-admin/edit.php?post_type=property2.5111.92
Settings /wp-admin/admin.php?page=trexanh_property_settings2.5013.61

Server storage [IO: ▲7.67MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 1,503 new files
Database: no new tables, 11 new options
New WordPress options
trexanhproperty_code_version
trexanhproperty_db_version
trexanhproperty_my_properties_page_id
trexanhproperty_payment_status_page_id
trexanhproperty_payment_page_id
trexanhproperty_properties_page_id
trexanhproperty_property_type_setting
trexanhproperty_general_settings
widget_trexanhproperty_widget_property_search_form
widget_trexanhproperty_widget_property_map_listing
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for TreXanh Property
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,118 ▲52220.01 ▲4.4119.14 ▲10.0645.55 ▼4.63
Dashboard /wp-admin3,275 ▲3448.43 ▲2.47223.69 ▲62.80108.08 ▼1.59
Posts /wp-admin/edit.php3,065 ▲3265.15 ▲2.43110.23 ▲45.1485.40 ▼5.05
Add New Post /wp-admin/post-new.php1,686 ▲9223.63 ▲4.80298.22 ▼98.03101.48 ▼12.53
Media Library /wp-admin/upload.php1,908 ▲986.16 ▲1.12147.98 ▼7.53115.35 ▼6.66
Config Property /wp-admin/admin.php?page=trexanh_property_settings&tab=trexanhproperty_property_type_setting5,1756.84228.77105.54
Orders /wp-admin/edit.php?post_type=property_order1,7314.94110.4077.43
/wp-admin/edit.php?post_type=property&page=wp-menu-separator280.900.0512.34
Add New House /wp-admin/post-new.php?post_type=property&property_type=house4,1419.69253.61151.17
Help /wp-admin/admin.php?page=trexanh_property_homepage1,4224.3681.0364.05
System /wp-admin/admin.php?page=trexanh_property_system1,4054.3599.5697.91
All Properties /wp-admin/edit.php?post_type=property1,8204.8091.6072.13
Settings /wp-admin/admin.php?page=trexanh_property_settings1,6835.2599.1887.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in TreXanhProperty\Core\Widget\PropertySearch is deprecated since version 4.3.0! Use __construct() instead.
  • The uninstall procedure has failed, leaving 11 options in the database
    • trexanhproperty_db_version
    • trexanhproperty_code_version
    • trexanhproperty_properties_page_id
    • widget_trexanhproperty_widget_property_search_form
    • trexanhproperty_submit_page_id
    • trexanhproperty_payment_page_id
    • widget_trexanhproperty_widget_property_map_listing
    • trexanhproperty_payment_status_page_id
    • trexanhproperty_general_settings
    • trexanhproperty_property_type_setting
    • ...

Smoke tests 0% 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)
Smoke test failed, please fix the following
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in TreXanhProperty\Core\Widget\PropertySearch is deprecated since version 4.3.0! Use __construct() instead.
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in TreXanhProperty\Core\Widget\PropertyMapListing is deprecated since version 4.3.0! Use __construct() instead.
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=property&property_type=house
    • > Notice in wp-content/plugins/trexanh-property/modules/Core/PropertyForm.php+350
    Undefined index: type

SRP 0% 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/trexanh-property/templates/js-templates/map-info-box.php
  • 761× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Omnipay\\Common\\AbstractGateway' not found in wp-content/plugins/trexanh-property/vendor/omnipay/stripe/src/Gateway.php:84
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Validator\\Date' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-validator/src/DateStep.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Service\\Command\\LocationVisitor\\Response\\AbstractResponseVisitor' not found in wp-content/plugins/trexanh-property/vendor/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ReasonPhraseVisitor.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Validator\\AbstractValidator' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-i18n/src/Validator/DateTime.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\ServiceManager\\AbstractPluginManager' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-filter/src/FilterPluginManager.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\ServiceManager\\Exception\\RuntimeException' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-servicemanager/src/Exception/CircularDependencyFoundException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Http\\ClientInterface' not found in wp-content/plugins/trexanh-property/vendor/guzzle/guzzle/src/Guzzle/Service/ClientInterface.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\View\\Helper\\HelperInterface' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-view/src/Helper/Navigation/HelperInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\File\\MimeType\\MimeTypeGuesserInterface' not found in wp-content/plugins/trexanh-property/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Stdlib\\Exception\\ExceptionInterface' not found in wp-content/plugins/trexanh-property/vendor/zendframework/zend-stdlib/src/Exception/InvalidArgumentException.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trexanh_property_settings
    • > Network (severe)
    http://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=property&page=wp-menu-separator
    • > Network (severe)
    wp-admin/edit.php?post_type=property&page=wp-menu-separator - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
You can take inspiration from this readme.txt

trexanh-property/trexanh-property.php 92% from 13 tests

Analyzing the main PHP file in "TreXanh Property" version 0.6
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin93,894 lines of code in 1,413 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,32715,97552,56581,801
Markdown411,32004,104
JavaScript205079632,397
XML224162,268
JSON12001,444
CSS586611,203
LESS51511585
Bourne Shell1203492

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity9.35
▷ Minimum class complexity1.00
▷ Maximum class complexity167.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces150
Interfaces166
Traits14
Classes868
▷ Abstract classes556.34%
▷ Concrete classes81393.66%
▷ Final classes131.60%
Methods6,111
▷ Static methods3665.99%
▷ Public methods5,46889.48%
▷ Protected methods5759.41%
▷ Private methods681.11%
Functions112
▷ Named functions2118.75%
▷ Anonymous functions9181.25%
Constants581
▷ Global constants122.07%
▷ Class constants56997.93%
▷ Public constants569100.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
47 PNG files occupy 1.73MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/js-marker-clusterer/images/m5.png6.68KB5.10KB▼ 23.66%
assets/lib/prettyphoto/images/prettyPhoto/dark_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
assets/lib/prettyphoto/images/prettyPhoto/facebook/contentPatternBottom.png0.14KB0.11KB▼ 21.13%
assets/lib/js-marker-clusterer/images/heart40.png2.11KB1.70KB▼ 19.48%
assets/lib/prettyphoto/images/prettyPhoto/facebook/btnNext.png0.83KB0.57KB▼ 30.77%