72% where-i-was-where-i-will-be

Code Review | Where I Was, Where I Will Be

WordPress plugin Where I Was, Where I Will Be scored72%from 54 tests.

About plugin

  • Plugin page: where-i-was-where...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jan 6, 2015
  • Latest release: Jan 10, 2017
  • Number of updates: 25
  • Update frequency: every 29.4 days
  • Top authors: mcnardelli (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

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

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

Server-side resources used by Where I Was, Where I Will Be
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.85 ▲2.01
Dashboard /wp-admin3.51 ▲0.2049.05 ▼2.07
Posts /wp-admin/edit.php3.70 ▲0.3553.99 ▲6.34
Add New Post /wp-admin/post-new.php6.11 ▲0.2296.78 ▼7.68
Media Library /wp-admin/upload.php3.43 ▲0.2045.75 ▲9.25
Manage Types /wp-admin/admin.php?page=wiw_type3.4235.65
Edit Locals /wp-admin/admin.php?page=wiw_edit_local3.4446.63
Manage Locals /wp-admin/admin.php?page=wiwwiwb3.4134.48
Settings /wp-admin/admin.php?page=wiw_settings3.4134.85
New Local /wp-admin/admin.php?page=wiw_new_local3.4338.22

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 289 new files
Database: 2 new tables, 9 new options
New tables
wp_wiw_type
wp_wiw_locals
New WordPress options
widget_theysaidso_widget
plugin_error
wiw_standard_text
theysaidso_admin_options
widget_recent-comments
wiw_standard_type
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Where I Was, Where I Will Be
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲22115.39 ▲1.0913.27 ▲11.1240.84 ▼3.22
Dashboard /wp-admin2,254 ▲666.07 ▲1.02117.52 ▲16.2789.76 ▲46.92
Posts /wp-admin/edit.php3,211 ▲1,1223.02 ▲1.0251.42 ▲13.8934.98 ▲3.46
Add New Post /wp-admin/post-new.php2,780 ▲1,25223.51 ▲5.34660.56 ▲0.4128.09 ▼34.89
Media Library /wp-admin/upload.php1,448 ▲605.20 ▲1.00110.62 ▲11.3672.21 ▲29.67
Manage Types /wp-admin/admin.php?page=wiw_type1,3323.9259.8882.20
Edit Locals /wp-admin/admin.php?page=wiw_edit_local1,0194.0049.9659.40
Manage Locals /wp-admin/admin.php?page=wiwwiwb8722.3432.5625.68
Settings /wp-admin/admin.php?page=wiw_settings1,0612.5237.1638.42
New Local /wp-admin/admin.php?page=wiw_new_local1,3453.7051.3668.56

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • wiw_standard_text
    • wiw_standard_type
    • plugin_error
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/where-i-was-where-i-will-be/wiwwiwb.php
  • 25× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WIW_DIR_INCLUDE - assumed 'WIW_DIR_INCLUDE' (this will throw an Error in a future version of PHP) in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/edit_local.php on line 1
    • > PHP Warning
      Use of undefined constant WIW_DIR_INCLUDE - assumed 'WIW_DIR_INCLUDE' (this will throw an Error in a future version of PHP) in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/type.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_media() in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/new_local.php:2
    • > PHP Warning
      Use of undefined constant WIW_DIR_INCLUDE - assumed 'WIW_DIR_INCLUDE' (this will throw an Error in a future version of PHP) in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/setting.php on line 1
    • > PHP Warning
      Use of undefined constant WIW_DIR_INCLUDE - assumed 'WIW_DIR_INCLUDE' (this will throw an Error in a future version of PHP) in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/new_local.php on line 1
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/where-i-was-where-i-will-be/system/include/include_user.php on line 7
    • > PHP Warning
      include_once(WIW_DIR_INCLUDEadmin.php): failed to open stream: No such file or directory in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/locals.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/insert/page_post.php:7
    • > PHP Warning
      include_once(): Failed opening 'WIW_DIR_INCLUDEadmin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/where-i-was-where-i-will-be/system/view/admin/edit_local.php on line 1
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/where-i-was-where-i-will-be/system/include/include_admin.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wiw_new_local
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&language&libraries=places%2Cgeometry%2Cdrawing&ver=6.3.1 246: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"
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wiw_new_local
    • > Network (severe)
    wp-admin/%image% - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === where-i-was-where-i-will-be === )
The official readme.txt is a good inspiration

where-i-was-where-i-will-be/wiwwiwb.php 92% from 13 tests

This is the main PHP file of "Where I Was, Where I Will Be" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("where-i-was-where-i-will-be.php" instead of "wiwwiwb.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,818 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP222591631,949
JavaScript58974465
PO File1131211292
CSS32634112

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.90
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods82
▷ Static methods00.00%
▷ Public methods82100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
255 PNG files occupy 1.14MB with 0.65MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/cd.png9.58KB3.71KB▼ 61.29%
assets/css/images/ui-bg_flat_15_cd0a0a_40x100.png0.20KB0.08KB▼ 57.77%
assets/images/flags/tl.png2.54KB1.37KB▼ 46.12%
assets/images/flags/fk.png10.71KB4.20KB▼ 60.78%
assets/images/flags/sa.png11.09KB4.64KB▼ 58.11%