78% b-locator

Code Review | b-Locator

WordPress plugin b-Locator scored78%from 54 tests.

About plugin

  • Plugin page: b-locator
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 15, 2017
  • Latest release: Oct 11, 2017
  • Number of updates: 26
  • Update frequency: every 3.4 days
  • Top authors: bryanrsebastian (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,002 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.30ms] Passed 4 tests

A check of server-side resources used by b-Locator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0530.75 ▼11.48
Dashboard /wp-admin3.45 ▲0.1554.14 ▲4.09
Posts /wp-admin/edit.php3.51 ▲0.1555.47 ▲4.05
Add New Post /wp-admin/post-new.php5.97 ▲0.0884.01 ▼21.25
Media Library /wp-admin/upload.php3.29 ▲0.0736.38 ▼0.52
Categories /wp-admin/edit-tags.php?taxonomy=location-categories&post_type=b-locator3.3238.64
Add New /wp-admin/post-new.php?post_type=b-locator3.4448.75
All Location /wp-admin/edit.php?post_type=b-locator3.3642.98

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
b_locator
can_compress_scripts

Browser metrics Passed 4 tests

b-Locator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,455 ▲70517.86 ▲3.4940.21 ▲38.3742.19 ▼3.38
Dashboard /wp-admin2,396 ▲1986.41 ▲0.40121.86 ▲14.6039.68 ▼2.27
Posts /wp-admin/edit.php2,292 ▲1893.31 ▲1.2846.19 ▲5.4032.39 ▼12.69
Add New Post /wp-admin/post-new.php1,558 ▲1023.23 ▼0.08633.39 ▲20.4344.43 ▼16.67
Media Library /wp-admin/upload.php1,435 ▲354.15 ▼0.0789.19 ▼22.5249.35 ▼2.43
Categories /wp-admin/edit-tags.php?taxonomy=location-categories&post_type=b-locator1,4693.1240.2531.65
Add New /wp-admin/post-new.php?post_type=b-locator2,3297.73175.0066.44
All Location /wp-admin/edit.php?post_type=b-locator1,2733.2944.1528.59

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • b_locator
    • 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/b-locator/backend/partials/noticeForAPIKey.php
    • > /wp-content/plugins/b-locator/backend/partials/instruction.php
    • > /wp-content/plugins/b-locator/backend/partials/updateNotice.php
    • > /wp-content/plugins/b-locator/frontend/partials/map.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_settings_sections() in wp-content/plugins/b-locator/backend/partials/form.php:4
    • > PHP Notice
      Undefined variable: search in wp-content/plugins/b-locator/frontend/partials/locationList.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_postdata() in wp-content/plugins/b-locator/frontend/partials/locationList.php:23
    • > PHP Notice
      Undefined variable: categories in wp-content/plugins/b-locator/frontend/partials/locationList.php on line 3
    • > PHP Notice
      Undefined variable: locations in wp-content/plugins/b-locator/frontend/partials/locationList.php on line 1
    • > PHP Notice
      Undefined variable: search in wp-content/plugins/b-locator/frontend/partials/locationList.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/b-locator/backend/partials/metaboxContent.php:4
    • > PHP Notice
      Undefined variable: categories in wp-content/plugins/b-locator/frontend/partials/locationList.php on line 1
    • > PHP Notice
      Undefined variable: map_height in wp-content/plugins/b-locator/frontend/partials/map.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

b-locator/BLocator.php 92% from 13 tests

The main file in "b-Locator" v. 1.0.1 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("b-locator.php" instead of "BLocator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected965 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14102240719
JavaScript23219162
CSS21084

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity8.86
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods46
▷ Static methods12.17%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.05MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
backend/imgs/buy-me-a-coffee.png51.76KB5.03KB▼ 90.29%