68% openbroker

Code Review | OpenBroker

WordPress plugin OpenBroker scored68%from 54 tests.

About plugin

  • Plugin page: openbroker
  • Plugin version: 2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 19, 2021
  • Latest release: Sep 29, 2023
  • Number of updates: 6
  • Update frequency: every 114.5 days
  • Top authors: teamopenbroker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /382 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.22MB] [CPU: ▼44.30ms] Passed 4 tests

A check of server-side resources used by OpenBroker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.75 ▼0.7213.95 ▼27.78
Dashboard /wp-admin2.80 ▼0.5116.90 ▼40.11
Posts /wp-admin/edit.php2.80 ▼0.5616.79 ▼33.15
Add New Post /wp-admin/post-new.php2.80 ▼3.0916.23 ▼76.17
Media Library /wp-admin/upload.php2.80 ▼0.4316.15 ▼21.34

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 264 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

OpenBroker: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲20717.15 ▲2.9816.32 ▲14.5247.57 ▼0.30
Dashboard /wp-admin2,247 ▲677.37 ▲1.71115.76 ▲26.8939.09 ▼0.11
Posts /wp-admin/edit.php2,149 ▲494.25 ▲2.2148.14 ▲11.0535.77 ▼2.38
Add New Post /wp-admin/post-new.php6,342 ▲4,81425.09 ▲2.04963.79 ▲290.1937.10 ▼18.88
Media Library /wp-admin/upload.php1,452 ▲585.74 ▲1.52112.97 ▼1.3741.73 ▼7.07

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 cannot be uninstalled
    • > Notice in wp-content/plugins/openbroker/initialize_functions.php+620
    unserialize(): Error at offset 0 of 1 bytes
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/openbroker/templates/frontend/page/similar-properties.php
    • > /wp-content/plugins/openbroker/templates/frontend/search/properties-search.php
    • > /wp-content/plugins/openbroker/templates/admin/ajax_properties.php
    • > /wp-content/plugins/openbroker/templates/frontend/catalog/only-properties.php
  • 100× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/examples/query_example.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/examples/raw_query_example.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/tests/StringLiteralFormatterTest.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/openbroker/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/openbroker/vendor/gmostafa/php-graphql-client/tests/Auth/AwsIamAuthTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestFactoryInterface' not found in wp-content/plugins/openbroker/vendor/guzzlehttp/psr7/src/HttpFactory.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/openbroker/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/openbroker/templates/frontend/page/single-property.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/openbroker/vendor/psr/http-client/src/NetworkExceptionInterface.php:14
    • > PHP Warning
      require_once(OPENBROKER_PLUGIN_LIB/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/openbroker/api/openbroker.php on line 2

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: properties, openbrocker, real estate, openbroker

openbroker/initialize_functions.php 92% from 13 tests

The primary PHP file in "OpenBroker" version 2.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("openbroker.php" instead of "initialize_functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected32,450 lines of code in 223 files:
LanguageFilesBlank linesComment linesLines of code
PHP1702,6637,15614,377
SVG3009,552
Markdown171,51604,375
CSS10353601,996
JSON11001,166
JavaScript1015662945
YAML29239

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity11.08
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces18
Interfaces28
Traits4
Classes114
▷ Abstract classes21.75%
▷ Concrete classes11298.25%
▷ Final classes3531.25%
Methods926
▷ Static methods14916.09%
▷ Public methods78985.21%
▷ Protected methods232.48%
▷ Private methods11412.31%
Functions134
▷ Named functions3626.87%
▷ Anonymous functions9873.13%
Constants70
▷ Global constants22.86%
▷ Class constants6897.14%
▷ Public constants5276.47%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.07MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/libs/selectstyle/img/search.png15.34KB1.43KB▼ 90.65%
templates/libs/selectstyle/img/ful_grid_img.png17.66KB0.52KB▼ 97.07%
templates/assets/img/logo.png20.48KB7.48KB▼ 63.46%
templates/libs/lightzoom/image/close.png2.51KB1.53KB▼ 39.15%
templates/libs/selectstyle/img/br_down.png17.38KB0.20KB▼ 98.85%