10% locationews

Code Review | Locationews

WordPress plugin Locationews scored10%from 54 tests.

About plugin

  • Plugin page: locationews
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Aug 17, 2018
  • Number of updates: 56
  • Update frequency: every 8.6 days
  • Top authors: anttiluokkanen (94.64%)deployer (7.14%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,438 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/locationews/classes/Plugin.php+126
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.29MB] [CPU: ▲1.41ms] Passed 4 tests

Server-side resources used by Locationews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1250.19 ▲6.65
Dashboard /wp-admin3.68 ▲0.3851.28 ▼0.45
Posts /wp-admin/edit.php3.73 ▲0.3850.81 ▲1.46
Add New Post /wp-admin/post-new.php6.23 ▲0.35100.36 ▼2.04
Media Library /wp-admin/upload.php3.55 ▲0.3240.82 ▲9.07
Import Settings /wp-admin/admin.php?page=locationews-json-settings3.4227.51
Edit Settings /wp-admin/admin.php?page=locationews-settings3.4329.84

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

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

Browser metrics Passed 4 tests

Locationews: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.65 ▼0.701.73 ▼0.0841.29 ▼1.47
Dashboard /wp-admin2,236 ▲484.87 ▼1.02108.76 ▼4.1540.62 ▼5.39
Posts /wp-admin/edit.php2,116 ▲242.00 ▼0.0040.10 ▲0.4238.02 ▲2.31
Add New Post /wp-admin/post-new.php1,657 ▲12923.29 ▲4.98672.01 ▲25.6179.20 ▲25.47
Media Library /wp-admin/upload.php1,412 ▲214.28 ▲0.0696.71 ▼3.2941.84 ▼0.15
Import Settings /wp-admin/admin.php?page=locationews-json-settings8742.5655.9937.43
Edit Settings /wp-admin/admin.php?page=locationews-settings1,5126.92131.97118.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=locationews-settings
    • > Notice in wp-content/plugins/locationews/classes/Plugin.php+220
    Undefined variable: post_meta

SRP 50% 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 take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractProvider' not found in wp-content/plugins/locationews/classes/Provider/I18n.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractPlugin' not found in wp-content/plugins/locationews/classes/Plugin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractProvider' not found in wp-content/plugins/locationews/classes/Provider/Public.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractProvider' not found in wp-content/plugins/locationews/classes/Provider/Admin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractProvider' not found in wp-content/plugins/locationews/classes/Provider/Metabox.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Locationews_AbstractProvider' not found in wp-content/plugins/locationews/classes/Provider/Options.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=locationews-settings
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key=AIzaSyDzBoxUanA44A1qpzSRJNQJL_f7CLEyisM&language=en&region=US&libraries=places&ver=2.0.6 234: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/admin.php?page=locationews-json-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught fca: Map: Expected mapDiv of type HTMLElement but was passed null.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: publishing, local, news, location, journalism...

locationews/locationews.php Passed 13 tests

The main PHP file in "Locationews" ver. 2.0.6 adds more information about the plugin and also serves as the entry point for this plugin
47 characters long description:
Publish location based articles in Locationews.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin5,007 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
CSS20272,742
PHP134439751,737
JavaScript95424263
PO File16880223
Markdown120041
JSON1001

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.50
Average class complexity26.60
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods83
▷ Static methods78.43%
▷ Public methods83100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions545.45%
▷ Anonymous functions654.55%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/locationewslogo.png7.78KB4.19KB▼ 46.07%
assets/img/locationewslogoretina.png16.29KB7.65KB▼ 53.01%
assets/img/icon-small.png1.44KB1.11KB▼ 22.90%
assets/img/locationewsmerkki.png2.71KB1.97KB▼ 27.25%
assets/img/locationewsmerkkinormaali.png1.44KB1.11KB▼ 22.90%