83% local-magic

Code Review | Local Magic

WordPress plugin Local Magic scored83%from 54 tests.

About plugin

  • Plugin page: local-magic
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.3.0
  • WordPress version: 6.3.1
  • First release: May 3, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 33
  • Update frequency: every 27.6 days
  • Top authors: matthewrubin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,675 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.35MB] [CPU: ▼5.73ms] Passed 4 tests

Server-side resources used by Local Magic
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3534.29 ▼8.04
Dashboard /wp-admin3.67 ▲0.3351.85 ▼6.85
Posts /wp-admin/edit.php3.79 ▲0.4347.45 ▲1.51
Add New Post /wp-admin/post-new.php6.26 ▲0.3779.07 ▼8.85
Media Library /wp-admin/upload.php3.60 ▲0.3634.63 ▲0.84

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 32 new files
Database: 4 new tables, 6 new options
New tables
wp_mrylm_cities
wp_mrylm_setting
wp_mrylm_jobs
wp_mrylm_news
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Local Magic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.36 ▲0.012.15 ▲0.3744.86 ▲2.06
Dashboard /wp-admin2,198 ▲185.56 ▼0.1692.04 ▲2.8568.69 ▲29.09
Posts /wp-admin/edit.php2,115 ▲151.98 ▼0.0336.78 ▲0.6832.57 ▼0.84
Add New Post /wp-admin/post-new.php1,553 ▲2723.15 ▼0.05759.44 ▲119.0752.70 ▲1.15
Media Library /wp-admin/upload.php1,418 ▲154.21 ▼0.02102.20 ▼2.8171.59 ▲29.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/local-magic/deactivate.php:4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/local-magic/deactivate.php on line 3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #7 is missing in local-magic/assets to your readme.txt
  • Screenshots: These screenshots do not have images: #1 (Local Magic Plugin Setting), #2 (Local Magic City/Keyword List in App)
The official readme.txt is a good inspiration

local-magic/local-magic.php 92% from 13 tests

The main PHP file in "Local Magic" ver. 2.2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 266 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin3,177 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP68797203,176
HTML1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity42.75
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity4.41
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods49
▷ Static methods24.08%
▷ Public methods3877.55%
▷ Protected methods12.04%
▷ Private methods1020.41%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants233.33%
▷ Class constants466.67%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-lm-light.png1.23KB0.47KB▼ 61.72%
assets/images/light-angle-down.png1.07KB0.37KB▼ 64.89%
assets/images/local-magic-logo.png11.19KB6.52KB▼ 41.72%
assets/images/brifcase.png1.15KB0.49KB▼ 57.37%
assets/images/icon-lm-dark.png1.23KB0.47KB▼ 61.81%