62% listar-directory-listing

Code Review | Listar - Directory Listing & Classifieds WordPress Plugin

WordPress plugin Listar - Directory Listing & Classifieds WordPress Plugin scored62%from 54 tests.

About plugin

  • Plugin page: listar-directory-...
  • Plugin version: 1.0.25
  • PHP compatiblity: 5.8+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-7.4
  • WordPress version: 6.3.1
  • First release: Aug 20, 2020
  • Latest release: Jun 14, 2023
  • Number of updates: 48
  • Update frequency: every 21.4 days
  • Top authors: passionui (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /7,018 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲1.57MB] [CPU: ▲11.81ms] Passed 4 tests

This is a short check of server-side resources used by Listar - Directory Listing & Classifieds WordPress Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.78 ▲1.3150.28 ▲9.22
Dashboard /wp-admin5.00 ▲1.6971.07 ▲19.02
Posts /wp-admin/edit.php5.05 ▲1.6971.57 ▲24.44
Add New Post /wp-admin/post-new.php8.27 ▲2.38105.87 ▼2.24
Media Library /wp-admin/upload.php4.84 ▲1.6057.09 ▲21.23
Add New /wp-admin/post-new.php?post_type=listar_team4.9665.68
All Members /wp-admin/edit.php?post_type=listar_team4.9356.47
Categories /wp-admin/edit-tags.php?taxonomy=listar_category&post_type=listar4.8749.00
Locations /wp-admin/edit-tags.php?taxonomy=listar_location&post_type=listar4.8756.03
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=listar4.8657.21
Add New /wp-admin/post-new.php?post_type=listar5.1168.49
All Listings /wp-admin/edit.php?post_type=listar4.9367.35
Features /wp-admin/edit-tags.php?taxonomy=listar_feature&post_type=listar4.8750.52
Settings /wp-admin/edit.php?post_type=listar&page=settings5.0355.48
Add New /wp-admin/post-new.php?post_type=listar_booking5.2565.55

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2,193 new files
Database: no new tables, 19 new options
New WordPress options
widget_listar_location
widget_listar_price_range
widget_recent-posts
widget_listar_data
widget_listar_post
widget_recent-comments
widget_listar_feature_menu
widget_theysaidso_widget
widget_listar_location_menu
widget_listar_rating_range
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Listar - Directory Listing & Classifieds WordPress Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,112 ▲35115.17 ▲0.791.94 ▲0.4138.63 ▼2.69
Dashboard /wp-admin2,475 ▲2986.91 ▲1.39134.45 ▲43.9743.15 ▼1.52
Posts /wp-admin/edit.php2,418 ▲3153.71 ▲1.6962.91 ▲24.3934.80 ▼0.73
Add New Post /wp-admin/post-new.php1,654 ▲12622.40 ▼0.81671.25 ▲53.5337.84 ▼20.14
Media Library /wp-admin/upload.php1,559 ▲1564.82 ▲0.6395.43 ▼12.3351.41 ▲8.84
Add New /wp-admin/post-new.php?post_type=listar_team1,9804.3684.4734.53
All Members /wp-admin/edit.php?post_type=listar_team1,3794.0259.0128.40
Categories /wp-admin/edit-tags.php?taxonomy=listar_category&post_type=listar4,6255.81123.1539.72
Locations /wp-admin/edit-tags.php?taxonomy=listar_location&post_type=listar1,6274.0448.7431.21
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=listar1,6414.0449.0530.97
Add New /wp-admin/post-new.php?post_type=listar10,2746.07190.9445.24
All Listings /wp-admin/edit.php?post_type=listar1,4573.6560.7937.52
Features /wp-admin/edit-tags.php?taxonomy=listar_feature&post_type=listar4,6255.76136.1436.57
Settings /wp-admin/edit.php?post_type=listar&page=settings1,4833.9650.9468.89
Add New /wp-admin/post-new.php?post_type=listar_booking2,6814.4575.3636.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 19 options in the database
    • widget_listar_post
    • theysaidso_admin_options
    • widget_listar_location
    • widget_listar_feature_menu
    • widget_listar_search_form
    • can_compress_scripts
    • widget_listar_category_menu
    • widget_recent-comments
    • widget_listar_post_category
    • db_upgraded
    • ...

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
    • > GET request to /wp-admin/edit-tags.php?taxonomy=listar_category&post_type=listar
    • > Notice in wp-content/plugins/listar-directory-listing/src/views/metadata/category.php+4
    Trying to get property 'color' of non-object
    • > GET request to /wp-admin/edit-tags.php?taxonomy=listar_category&post_type=listar
    • > Notice in wp-content/plugins/listar-directory-listing/src/views/metadata/category.php+9
    Trying to get property 'icon' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=listar
    • > Notice in wp-content/plugins/listar-directory-listing/src/Models/Place_Model.php+240
    Undefined index: gallery

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/build.php
  • 343× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BraintreeHttp\\HttpRequest' not found in wp-content/plugins/listar-directory-listing/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/AccountLink.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/Issuing/Card.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/listar-directory-listing/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemCancelTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/OrderItem.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'PayPalHttp\\Environment' not found in wp-content/plugins/listar-directory-listing/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalEnvironment.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\StripeClientInterface' not found in wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/lib/BaseStripeClient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PaypalPayoutsSDK\\Core\\PayPalEnvironment' not found in wp-content/plugins/listar-directory-listing/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/ProductionEnvironment.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5 in listar-directory-listing/assets to your readme.txt
Please take inspiration from this readme.txt

listar-directory-listing/listar.php 85% from 13 tests

"Listar - Directory Listing & Classifieds WordPress Plugin" version 1.0.25's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("listar-directory-listing.php" instead of "listar.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/listar-directory-listing/vendor/stripe/stripe-php/data/ca-certificates.crt
156,931 lines of code in 2,148 files:
LanguageFilesBlank linesComment linesLines of code
JSON90060,940
YAML90025,274
PHP43738,63269,42024,841
SVG1,60402415,855
CSS173,7281189,460
JavaScript181,0154549,314
Sass18507344,760
LESS18504554,718
Markdown1180901,485
PO File18594200
XML45055
make19027
Ruby1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.74
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces50
Interfaces16
Traits7
Classes384
▷ Abstract classes153.91%
▷ Concrete classes36996.09%
▷ Final classes00.00%
Methods1,506
▷ Static methods33922.51%
▷ Public methods1,37491.24%
▷ Protected methods442.92%
▷ Private methods885.84%
Functions58
▷ Named functions2441.38%
▷ Anonymous functions3458.62%
Constants766
▷ Global constants60.78%
▷ Class constants76099.22%
▷ Public constants760100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/default-featured-image.png6.39KB2.16KB▼ 66.22%