78% planetary-position

Code Review | Planetary Position

WordPress plugin Planetary Position scored78%from 54 tests.

About plugin

  • Plugin page: planetary-position
  • Plugin version: 1.5.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 17, 2023
  • Latest release: Sep 8, 2023
  • Number of updates: 54
  • Update frequency: every 3.8 days
  • Top authors: wsameer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /871 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.06MB] [CPU: ▼2.54ms] Passed 4 tests

An overview of server-side resources used by Planetary Position
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0840.31 ▼2.76
Dashboard /wp-admin3.36 ▲0.0646.80 ▲2.54
Posts /wp-admin/edit.php3.48 ▲0.1249.61 ▲1.34
Add New Post /wp-admin/post-new.php5.94 ▲0.0685.31 ▼9.92
Media Library /wp-admin/upload.php3.29 ▲0.0634.26 ▲1.17
Planetary Position /wp-admin/options-general.php?page=planetary-position3.3029.76

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 9 new options
New WordPress options
pp_plugin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
pp_ayan
widget_planetary-position-widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Planetary Position
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲22115.43 ▲1.05106.79 ▲104.8347.13 ▼23.22
Dashboard /wp-admin2,213 ▲285.85 ▼0.16109.73 ▲9.8737.85 ▼7.00
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0240.43 ▼0.5636.48 ▼2.90
Add New Post /wp-admin/post-new.php1,523 ▼1923.55 ▲5.53653.61 ▲41.4249.62 ▲0.12
Media Library /wp-admin/upload.php1,386 ▲14.20 ▼0.0196.53 ▲1.4441.84 ▲0.24
Planetary Position /wp-admin/options-general.php?page=planetary-position9272.0524.2526.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • pp_ayan
    • widget_theysaidso_widget
    • widget_planetary-position-widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=planetary-position
    • > Notice in wp-content/plugins/planetary-position/views/admin.php+68
    Undefined index: pp_ayan
    • > GET request to /wp-admin/options-general.php?page=planetary-position
    • > Notice in wp-content/plugins/planetary-position/views/admin.php+64
    Undefined index: pp_showPanchang
    • > GET request to /wp-admin/options-general.php?page=planetary-position
    • > Notice in wp-content/plugins/planetary-position/views/admin.php+65
    Undefined index: pp_showTable
    • > GET request to /wp-admin/options-general.php?page=planetary-position
    • > Notice in wp-content/plugins/planetary-position/views/admin.php+66
    Undefined index: pp_showWheels
    • > GET request to /wp-admin/options-general.php?page=planetary-position
    • > Notice in wp-content/plugins/planetary-position/views/admin.php+67
    Undefined index: pp_showMoon

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/planetary-position/views/admin.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/planetary-position/widgets/planetary-position-widget.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/planetary-position/class-planetary-position-admin.php:10

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

planetary-position/planetary-position.php Passed 13 tests

The entry point to "Planetary Position" version 1.5.2 is a PHP file that has certain tags in its header comment area
37 characters long description:
Plugin to display Planetary Positions

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected17,624 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,0381,27616,762
CSS29326540
PHP610540316
SVG6006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.33
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods728.00%
▷ Public methods1768.00%
▷ Protected methods00.00%
▷ Private methods832.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 2.90MB with 0.82MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/moon.png30.33KB30.26KB0.23%
images/zodiac-wheel9.png178.53KB164.60KB▼ 7.80%
images/nax7.png2,760.93KB647.22KB▼ 76.56%