10% moon-phase-widget

Code Review | Moon Phase Widget

WordPress plugin Moon Phase Widget scored10%from 54 tests.

About plugin

  • Plugin page: moon-phase-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8.0
  • WordPress version: 6.3.1
  • First release: Dec 14, 2013
  • Latest release: Dec 14, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: DuncanMarshall (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

30+ active /2,498 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/moon-phase-widget/moon-phase-widget.php+113
    Function create_function() is deprecated

Server metrics [RAM: ▼2.22MB] [CPU: ▼60.70ms] Passed 4 tests

A check of server-side resources used by Moon Phase Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.674.60 ▼38.97
Dashboard /wp-admin2.08 ▼1.555.44 ▼62.08
Posts /wp-admin/edit.php2.08 ▼1.605.81 ▼47.51
Add New Post /wp-admin/post-new.php2.08 ▼4.065.68 ▼94.23
Media Library /wp-admin/upload.php2.08 ▼1.416.11 ▼33.03

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_moonphase_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Moon Phase Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.73 ▲0.351.74 ▼0.2545.98 ▲1.58
Dashboard /wp-admin2,195 ▲245.70 ▲0.0183.15 ▼8.5139.19 ▲1.06
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0838.40 ▼1.0036.84 ▲2.79
Add New Post /wp-admin/post-new.php1,526 ▼517.52 ▼5.51706.59 ▲20.0853.99 ▼12.19
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.07108.99 ▼1.4447.53 ▼1.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/moon-phase-widget/moon-phase-widget.php+113
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_moonphase_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/moon-phase-widget/moon-phase-widget.php:32

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (This shows the widget setup in the dashboard.), #2 (This shows the widget in action. You can style this from within the dashboard.)
The official readme.txt might help

moon-phase-widget/moon-phase-widget.php Passed 13 tests

The main PHP file in "Moon Phase Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
37 characters long description:
Sidebar widget to show the moon phase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin54 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1422154

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin