84% lunasolcal-sun-info-widget

Code Review | LunaSolCal - Sun Info Widget

WordPress plugin LunaSolCal - Sun Info Widget scored84%from 54 tests.

About plugin

  • Plugin page: lunasolcal-sun-in...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.3
  • WordPress version: 6.3.1
  • First release: Jan 20, 2022
  • Latest release: Jan 22, 2022
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: volkerv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.91ms] Passed 4 tests

An overview of server-side resources used by LunaSolCal - Sun Info Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.47 ▼2.17
Dashboard /wp-admin3.41 ▲0.1049.69 ▼4.55
Posts /wp-admin/edit.php3.52 ▲0.1746.70 ▼3.15
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.84 ▼13.76
Media Library /wp-admin/upload.php3.33 ▲0.1038.44 ▲3.67

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_sun_info
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for LunaSolCal - Sun Info Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.111.76 ▼0.0446.67 ▲0.81
Dashboard /wp-admin2,189 ▲95.54 ▼0.0988.07 ▼5.1440.52 ▼4.58
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.0034.81 ▼0.2232.30 ▼0.85
Add New Post /wp-admin/post-new.php1,545 ▼023.00 ▼0.19631.31 ▼81.1858.85 ▼2.14
Media Library /wp-admin/upload.php1,400 ▼04.24 ▼0.0498.19 ▼4.0244.90 ▼0.83

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_sun_info
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lunasolcal-sun-info-widget/classes/lsc_sun_info_widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: sun, sunrise, sunset

lunasolcal-sun-info-widget/lsc_sun_info.php 85% from 13 tests

Analyzing the main PHP file in "LunaSolCal - Sun Info Widget" version 1.0
Please take the time to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lunasolcal-sun-info-widget.php" instead of "lsc_sun_info.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected581 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP311298506
PO File3214575

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/sun_240.png57.91KB21.23KB▼ 63.35%