77% prakiraan-cuaca

Code Review | Prakiraan cuaca

WordPress plugin Prakiraan cuaca scored77%from 54 tests.

About plugin

  • Plugin page: prakiraan-cuaca
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Jul 19, 2022
  • Latest release: Jul 29, 2023
  • Number of updates: 36
  • Update frequency: every 10.4 days
  • Top authors: helmimubarak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /702 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.90ms] Passed 4 tests

An overview of server-side resources used by Prakiraan cuaca
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.57 ▲2.04
Dashboard /wp-admin3.35 ▲0.0546.55 ▼9.89
Posts /wp-admin/edit.php3.46 ▲0.1148.45 ▼3.45
Add New Post /wp-admin/post-new.php5.95 ▲0.0687.87 ▼13.18
Media Library /wp-admin/upload.php3.27 ▲0.0437.53 ▼1.07

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Prakiraan cuaca
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.52 ▼0.8810.69 ▲8.6745.93 ▲0.67
Dashboard /wp-admin2,202 ▲255.61 ▲0.0184.50 ▼4.1140.23 ▼5.93
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0534.90 ▼2.3433.29 ▼8.28
Add New Post /wp-admin/post-new.php1,530 ▼523.70 ▲5.51695.51 ▼51.8057.10 ▼16.92
Media Library /wp-admin/upload.php1,395 ▼54.12 ▲0.06101.99 ▼12.3046.49 ▼3.97

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 did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/prakiraan-cuaca/admin/partials/prakiraan-cuaca-dan-info-gempa-admin-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/prakiraan-cuaca/public/partials/prakiraan-cuaca-dan-info-gempa-public-display.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === prakiraan-cuaca === )
Please take inspiration from this readme.txt

prakiraan-cuaca/prakiraan-cuaca-dan-info-gempa.php 85% from 13 tests

"Prakiraan cuaca" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("prakiraan-cuaca.php" instead of "prakiraan-cuaca-dan-info-gempa.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected380 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP12163378333
SVG11033
CSS32107
JavaScript35607

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 2.88MB with 2.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png46.00KB6.73KB▼ 85.37%
assets/icon-128x128.png30.95KB3.56KB▼ 88.49%
assets/banner-772x250-rtl.png227.91KB101.37KB▼ 55.52%
assets/banner-772x250.png227.91KB101.37KB▼ 55.52%
assets/screenshot-2.png432.57KB132.11KB▼ 69.46%