72% widget-logic-visual

Code Review | Widget Logic Visual

WordPress plugin Widget Logic Visual scored72%from 54 tests.

About plugin

  • Plugin page: widget-logic-visual
  • Plugin version: 1.52
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.3.1
  • WordPress version: 6.3.1
  • First release: Feb 1, 2012
  • Latest release: Feb 28, 2012
  • Number of updates: 12
  • Update frequency: every 6.3 days
  • Top authors: totalbounty (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

400+ active /37,468 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.47ms] 75% from 4 tests

Server-side resources used by Widget Logic Visual
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 615.45ms on /wp-admin/options-general.php?page=widget-logic-visual-setting)
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.77 ▼4.39
Dashboard /wp-admin3.33 ▲0.0244.76 ▼0.45
Posts /wp-admin/edit.php3.38 ▲0.0244.69 ▼2.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.52 ▼14.55
Media Library /wp-admin/upload.php3.25 ▲0.0237.13 ▲3.65
Widget Logic Visual /wp-admin/options-general.php?page=widget-logic-visual-setting3.30615.45

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Widget Logic Visual
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.65 ▼0.641.58 ▼0.1139.22 ▼6.46
Dashboard /wp-admin2,216 ▲345.30 ▲0.42115.09 ▲13.8539.12 ▼4.88
Posts /wp-admin/edit.php2,102 ▲102.43 ▲0.3746.40 ▲2.2932.07 ▼3.28
Add New Post /wp-admin/post-new.php1,523 ▼1923.48 ▲5.32661.09 ▲22.5052.17 ▲0.73
Media Library /wp-admin/upload.php1,395 ▲104.63 ▲0.44123.00 ▲17.6646.57 ▲4.83
Widget Logic Visual /wp-admin/options-general.php?page=widget-logic-visual-setting9032.0036.0729.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • 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
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Notice in wp-content/plugins/widget-logic-visual/widget_logic.php+353
    Undefined variable: maxitems

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widget-logic-visual/ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/widget-logic-visual/widget_logic.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'msie')" "TypeError: Cannot read properties of undefined (reading 'msie')\n at /wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:22:11518\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:22:12147)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmAnims is not a function" "TypeError: $.nmAnims is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:23:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:24:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:25:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:26:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:27:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:28:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:29:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:30:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:31:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:32:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:33:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmFilters is not a function" "TypeError: $.nmFilters is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:34:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $.nmObj is not a function" "TypeError: $.nmObj is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/widget-logic-visual/js/jquery.nyromodal.js?ver=6.3.1:35:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > 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 TypeError: Cannot read properties of undefined (reading 'msie')
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > 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 TypeError: $.nmAnims is not a function
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > 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 TypeError: $.nmFilters is not a function
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > 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 TypeError: $.nmObj is not a function
    • > GET request to /wp-admin/options-general.php?page=widget-logic-visual-setting
    • > Network (severe)
    http://www.totalbounty.com/wp-content/themes/total_bounty/images/logo-bt.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Once the plugin is installed, the bottom of every widget has a new "edit visibility" button like the one in this image. Just click that button to restrict where the widget will display on your website (otherwise it will show on all pages)), #2 (Once you click that buton you get a lightbox popup window to choose "add new limitation (visual)" or "using conditional tag code (advanced). Click one or the other to get started.), #3 (Once you click "add new" you get a dropdown to choose where to show the widget (homepage, posts, pages, tags, categories, 404 page, author pages). Choose the places you want to show the widget or click "except" to not show the widget on those pages. This example shows adding a limitation for all category pages. Choose all or any you'd like to display on.), #4 (In this example we see how if you uncheck "all categories" a multi-select box appears where you can select one or more individual category pages (if you don't want them all). The same thing happens if you uncheck "all" for posts, pages, authors, attachments, tags, etc.), #5 (An example of adding a limitation to make a widget show on every page of the website except the homepage.), #6 (This is an example of adding conditional tag code. You must add the code and check the "activate the code" and click "update" for it to work. This is in case you want to try a conditional tag, de-activate it (to try a visual version) and then come back later to activate it again (the code you last used is saved in the box).), #7 (This is an error illustrating what will happen if you try to add both conditional tag code and a visual limitation (you can't have both, it's one or the other))
The official readme.txt is a good inspiration

widget-logic-visual/widget_logic.php 92% from 13 tests

This is the main PHP file of "Widget Logic Visual" version 1.52, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("widget-logic-visual.php" instead of "widget_logic.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
Success! There were no dangerous files found in this plugin1,199 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3333921,026
CSS2121159
JavaScript102114

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.34MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png49.92KB16.28KB▼ 67.39%
screenshot-3.png39.25KB13.83KB▼ 64.75%
screenshot-2.png48.86KB15.93KB▼ 67.39%
screenshot-4.png51.36KB16.70KB▼ 67.48%
images/logo-title.png29.39KB10.79KB▼ 63.29%