83% office-locator

Code Review | Office Locator

WordPress plugin Office Locator scored83%from 54 tests.

About plugin

  • Plugin page: office-locator
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 30, 2023
  • Latest release: Sep 4, 2023
  • Number of updates: 10
  • Update frequency: every 15.8 days
  • Top authors: webbytemplate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /577 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.76MB] [CPU: ▲0.91ms] Passed 4 tests

This is a short check of server-side resources used by Office Locator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.8140.80 ▲4.21
Dashboard /wp-admin4.09 ▲0.7449.29 ▼11.75
Posts /wp-admin/edit.php4.14 ▲0.7848.79 ▲3.43
Add New Post /wp-admin/post-new.php6.69 ▲0.80203.99 ▲104.57
Media Library /wp-admin/upload.php3.95 ▲0.7242.87 ▲7.75
Office Locator /wp-admin/admin.php?page=office-locator3.9838.42
Add New /wp-admin/post-new.php?post_type=offices3.99160.44
All Offices /wp-admin/edit.php?post_type=offices3.9938.43

Server storage [IO: ▲3.67MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Office Locator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,074 ▲31319.64 ▲5.3538.29 ▲36.7246.45 ▲8.08
Dashboard /wp-admin2,304 ▲1295.57 ▼0.1589.59 ▼23.4378.16 ▲33.19
Posts /wp-admin/edit.php2,227 ▲1271.98 ▼0.0335.80 ▼2.2734.01 ▼3.36
Add New Post /wp-admin/post-new.php1,644 ▲11823.22 ▲0.12691.28 ▲8.5357.79 ▼0.90
Media Library /wp-admin/upload.php1,521 ▲1244.11 ▼0.12101.20 ▼7.9072.98 ▲27.48
Office Locator /wp-admin/admin.php?page=office-locator1,3676.8776.6195.63
Add New /wp-admin/post-new.php?post_type=offices1,7192.5548.3464.21
All Offices /wp-admin/edit.php?post_type=offices1,2001.9533.7730.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • office_locator_general
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • office_locator_map
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-2.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-7.php:9
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-4.php on line 3
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-8.php on line 3
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-6.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-4.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-5.php:9
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-7.php on line 3
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-5.php on line 3
    • > PHP Notice
      Undefined variable: olcMapAttr in wp-content/plugins/office-locator/public/template-parts/layout/office-locator-layout-3.php on line 3

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

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Requires php: Invalid version format
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

office-locator/office-locator.php 92% from 13 tests

The main file in "Office Locator" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected7,486 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP258231,0933,403
CSS81231322,207
JSON600956
JavaScript613288820
SVG4180100

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity56.83
▷ Minimum class complexity1.00
▷ Maximum class complexity347.00
Average method complexity8.20
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods94
▷ Static methods22.13%
▷ Public methods9196.81%
▷ Protected methods00.00%
▷ Private methods33.19%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/map-styles/Layout-3.png2.09KB0.98KB▼ 53.14%
admin/images/map-styles/night.png1.08KB1.11KB0.00%
admin/images/map-styles/dark.png1.07KB1.09KB0.00%
admin/images/map-styles/Layout-4.png2.08KB0.98KB▼ 52.84%
admin/images/user-marker/yellow.png0.94KB0.51KB▼ 45.57%