72% qibla-directory

Code Review | Qibla Directory

WordPress plugin Qibla Directory scored72%from 54 tests.

About plugin

  • Plugin page: qibla-directory
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 15, 2018
  • Latest release: Dec 17, 2018
  • Number of updates: 49
  • Update frequency: every 6.2 days
  • Top authors: appandmap (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,581 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.72MB] [CPU: ▲13.68ms] Passed 4 tests

Analyzing server-side resources used by Qibla Directory
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.28 ▲1.8255.88 ▲13.90
Dashboard /wp-admin4.96 ▲1.6663.54 ▲12.35
Posts /wp-admin/edit.php5.09 ▲1.7373.06 ▲25.77
Add New Post /wp-admin/post-new.php8.08 ▲2.19103.81 ▲6.69
Media Library /wp-admin/upload.php4.88 ▲1.6556.51 ▲21.77
Install Plugins /wp-admin/themes.php?page=qibla-directory-install-plugins4.8948.55
Categories /wp-admin/edit-tags.php?taxonomy=listing_categories&post_type=listings6.4099.94
Add Listing /wp-admin/post-new.php?post_type=listings5.5788.16
Qibla Directory /wp-admin/admin.php?page=qibla-directory-options5.0459.86
Plugin Options /wp-admin/admin.php?page=?page=qibla-directory-options4.6241.39
Amenities /wp-admin/edit-tags.php?taxonomy=amenities&post_type=listings6.38101.63
Useful Links /wp-admin/admin.php?page=qb-useful-links4.8748.92
Listings /wp-admin/edit.php?post_type=listings4.9554.53
Locations /wp-admin/edit-tags.php?taxonomy=locations&post_type=listings5.9968.03

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 939 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Qibla Directory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,180 ▲41913.91 ▼0.7411.51 ▲9.8237.95 ▼3.84
Dashboard /wp-admin2,319 ▲1395.95 ▲0.2092.22 ▲2.2176.45 ▲31.57
Posts /wp-admin/edit.php2,251 ▲1512.45 ▲0.4139.82 ▲1.7741.63 ▲2.30
Add New Post /wp-admin/post-new.php1,807 ▲28123.20 ▲5.77691.21 ▲7.1533.05 ▼18.91
Media Library /wp-admin/upload.php1,535 ▲1384.53 ▲0.32107.25 ▼6.3182.86 ▲35.51
Install Plugins /wp-admin/themes.php?page=qibla-directory-install-plugins1,1292.1226.8836.74
Categories /wp-admin/edit-tags.php?taxonomy=listing_categories&post_type=listings11,6782.6052.0891.92
Add Listing /wp-admin/post-new.php?post_type=listings4,10714.36319.85274.17
Qibla Directory /wp-admin/admin.php?page=qibla-directory-options1,0712.1032.8948.58
Plugin Options /wp-admin/admin.php?page=?page=qibla-directory-options280.440.074.05
Amenities /wp-admin/edit-tags.php?taxonomy=amenities&post_type=listings11,5542.4235.9767.60
Useful Links /wp-admin/admin.php?page=qb-useful-links1,0612.2529.1947.02
Listings /wp-admin/edit.php?post_type=listings1,3032.4734.6976.43
Locations /wp-admin/edit-tags.php?taxonomy=locations&post_type=listings1,4192.4832.1541.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% 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 no errors were found, this is by no means an exhaustive test

SRP 0% from 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
Please fix the following
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/qibla-directory/views/map/markerClusterer.php
    • > /wp-content/plugins/qibla-directory/views/template/alert.php
    • > /wp-content/plugins/qibla-directory/views/relatedPosts.php
    • > /wp-content/plugins/qibla-directory/views/share/shareAndWish.php
    • > /wp-content/plugins/qibla-directory/views/shortcodes/maps.php
    • > /wp-content/plugins/qibla-directory/views/socialsLinks.php
    • > /wp-content/plugins/qibla-directory/views/termsList.php
    • > /wp-content/plugins/qibla-directory/views/map/googleMap.php
    • > /wp-content/plugins/qibla-directory/views/map/infoWindow.php
    • > /wp-content/plugins/qibla-directory/views/map/marker.php
  • 282× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'QiblaDirectory\\Form\\Factories\\FieldFactory' not found in wp-content/plugins/qibla-directory/inc/settingFields/googleMapFields.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'QiblaDirectory\\Form\\Abstracts\\Type' not found in wp-content/plugins/qibla-directory/src/Form/Types/Typography.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'QiblaDirectory\\Request\\DirectorRequestInterface' not found in wp-content/plugins/qibla-directory/src/Request/AbstractDirectorRequest.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'QiblaDirectory\\Form\\Factories\\FieldFactory' not found in wp-content/plugins/qibla-directory/inc/listingFormFields/taxTermsFields.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/qibla-directory/inc/listingsFiltersFields.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'QiblaDirectory\\Plugin' not found in wp-content/plugins/qibla-directory/requires.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'QiblaDirectory\\Admin\\Settings\\AbstractSettingsForm' not found in wp-content/plugins/qibla-directory/src/Admin/Settings/GoogleMap.php:38
    • > PHP Fatal error
      Uncaught Error: Interface 'QiblaDirectory\\Admin\\Termbox\\TermboxInterface' not found in wp-content/plugins/qibla-directory/src/Admin/Termbox/AbstractTermbox.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/qibla-directory/views/search/form.php:28
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/qibla-directory/views/customFields/listings/listingsLocation.php on line 26

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=listings
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?v=3.29&key&libraries=places&geocoding&ver=3.28 235:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/post-new.php?post_type=listings
    • > Console-api (severe) in unknown
    http://maps.googleapis.com/maps/api/js?v=3.29&key&libraries=places&geocoding&ver=3.28 153:248 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"
    • > GET request to /wp-admin/admin.php?page=?page=qibla-directory-options
    • > Network (severe)
    wp-admin/admin.php?page=?page=qibla-directory-options - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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
These attributes need your attention:
  • Requires at least: Invalid plugin version format
  • Requires php: Invalid plugin version format
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

qibla-directory/index.php 92% from 13 tests

The main file in "Qibla Directory" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("qibla-directory.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin59,176 lines of code in 763 files:
LanguageFilesBlank linesComment linesLines of code
PHP4294,69527,87922,147
Sass2022,4863,67611,963
JavaScript781,7835,2208,519
PO File181,8772,5005,973
SVG6035,493
CSS218952643,482
JSON6001,304
YAML1633186
Markdown135097
XML10012

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.46
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces64
Interfaces38
Traits0
Classes273
▷ Abstract classes3211.72%
▷ Concrete classes24188.28%
▷ Final classes135.39%
Methods1,103
▷ Static methods807.25%
▷ Public methods95286.31%
▷ Protected methods998.98%
▷ Private methods524.71%
Functions203
▷ Named functions12662.07%
▷ Anonymous functions7737.93%
Constants39
▷ Global constants410.26%
▷ Class constants3589.74%
▷ Public constants35100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/imgs/qibla-mark-16x16.png0.76KB0.97KB0.00%
assets/imgs/banner-premium.png122.93KB39.40KB▼ 67.95%
assets/vendor/photoswipe/default-skin.png0.53KB0.72KB0.00%
assets/imgs/vc-sc-icon.png1.95KB0.83KB▼ 57.46%