10% dilemma-lite

Code Review | Dilemma Lite

WordPress plugin Dilemma Lite scored10%from 54 tests.

About plugin

  • Plugin page: dilemma-lite
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Sep 6, 2014
  • Latest release: Jul 15, 2017
  • Number of updates: 12
  • Update frequency: every 87.1 days
  • Top authors: mikemayhem3030 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,053 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+66
    Undefined variable: dilemma_db_version

Server metrics [RAM: ▼0.63MB] [CPU: ▼15.64ms] 75% from 4 tests

This is a short check of server-side resources used by Dilemma Lite
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,934.64ms on /wp-admin/admin.php?page=dilemma-plugin-config)
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.36 ▼3.14
Dashboard /wp-admin3.37 ▲0.0753.84 ▲3.38
Posts /wp-admin/edit.php3.42 ▲0.0754.02 ▲0.17
Add New Post /wp-admin/post-new.php3.16 ▼2.7335.71 ▼62.48
Media Library /wp-admin/upload.php3.29 ▲0.0737.75 ▲2.89
Dilemmas /wp-admin/edit.php?post_type=dilemma3.3437.16
Dilemma Tags /wp-admin/edit-tags.php?taxonomy=dilemma-tags&post_type=dilemma3.2935.07
Settings /wp-admin/admin.php?page=dilemma-plugin-settings3.2630.99
Dilemma Categories /wp-admin/edit-tags.php?taxonomy=dilemma-cats&post_type=dilemma3.2930.31
Dilemma /wp-admin/admin.php?page=dilemma-plugin-config3.371,934.64
Manually Add Dilemma /wp-admin/post-new.php?post_type=dilemma3.1641.44

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: 1 new table, 14 new options
New tables
wp_dil_ip
New WordPress options
dilemma_db_version
widget_theysaidso_widget
dilIP
widget_recent-comments
dil_aff
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
dil_love
ds
...

Browser metrics Passed 4 tests

An overview of browser requirements for Dilemma Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,008 ▲24713.57 ▼0.718.71 ▲6.8842.43 ▼1.46
Dashboard /wp-admin2,252 ▲755.71 ▲0.0889.21 ▲0.2477.79 ▲40.30
Posts /wp-admin/edit.php2,186 ▲862.33 ▲0.3449.13 ▲8.5235.56 ▼2.52
Add New Post /wp-admin/post-new.php1,585 ▲5923.03 ▼0.26636.07 ▼39.8336.88 ▼19.86
Media Library /wp-admin/upload.php1,479 ▲794.44 ▲0.23109.92 ▲2.2866.70 ▲16.37
Dilemmas /wp-admin/edit.php?post_type=dilemma1,2752.2843.0633.53
Dilemma Tags /wp-admin/edit-tags.php?taxonomy=dilemma-tags&post_type=dilemma1,3291.9030.7732.72
Settings /wp-admin/admin.php?page=dilemma-plugin-settings1,0022.9869.4733.40
Dilemma Categories /wp-admin/edit-tags.php?taxonomy=dilemma-cats&post_type=dilemma1,3632.0533.2328.84
Dilemma /wp-admin/admin.php?page=dilemma-plugin-config1,1402.9974.0041.16
Manually Add Dilemma /wp-admin/post-new.php?post_type=dilemma2,1903.1270.6467.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_dil_ip
  • The uninstall procedure has failed, leaving 12 options in the database
    • dilIP
    • can_compress_scripts
    • dil_db_version
    • ds
    • db_upgraded
    • dil_aff
    • diltimer
    • widget_recent-comments
    • widget_theysaidso_widget
    • dil_love
    • ...

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/admin.php?page=dilemma-plugin-config
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+556
    Undefined variable: maxitems
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1575
    Undefined index: dilA
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1576
    Undefined index: dilB
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1577
    Undefined index: winA
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1578
    Undefined index: winB
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1579
    Undefined index: image_location1
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1580
    Undefined index: image_location2
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1584
    Undefined index: cleft
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Notice in wp-content/plugins/dilemma-lite/Dilemma.php+1585
    Undefined index: cright

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dilemma-lite/Dilemma.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dilemma
    • > Network (severe)
    wp-content/plugins/dilemma-lite/i/ae-bg-400t.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=dilemma-plugin-config
    • > Network (severe)
    wp-content/plugins/dilemma-lite/i/wpeddit-thumb.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: you rather, yes, dilemma, yourrather, no

dilemma-lite/Dilemma.php 85% from 13 tests

"Dilemma Lite" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 197 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("dilemma-lite.php" instead of "Dilemma.php")

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
There were no executable files found in this plugin2,830 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP1447791,230
CSS49343951
JavaScript692115341
HTML1144186
PO File147101122

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
23 PNG files occupy 0.53MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
documentation/assets/images/image_6.png21.42KB6.53KB▼ 69.53%
documentation/assets/images/image_2.png71.04KB19.31KB▼ 72.82%
documentation/assets/images/image_5.png21.09KB6.55KB▼ 68.94%
i/dilemmalogo.png3.17KB2.16KB▼ 31.89%
i/fbshare.png2.91KB2.11KB▼ 27.45%