77% respek-nature

Code Review | ReSpek Nature

WordPress plugin ReSpek Nature scored77%from 54 tests.

About plugin

  • Plugin page: respek-nature
  • Plugin version: 1.0.45
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 18, 2022
  • Latest release: Dec 5, 2022
  • Number of updates: 17
  • Update frequency: every 6.4 days
  • Top authors: respeknature (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /842 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.55ms] Passed 4 tests

This is a short check of server-side resources used by ReSpek Nature
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1543.13 ▼2.41
Dashboard /wp-admin3.45 ▲0.1551.62 ▼2.53
Posts /wp-admin/edit.php3.57 ▲0.2151.15 ▼0.35
Add New Post /wp-admin/post-new.php6.03 ▲0.15101.00 ▼4.90
Media Library /wp-admin/upload.php3.38 ▲0.1542.00 ▲4.87

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ReSpek Nature
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.27 ▼0.341.78 ▼0.1145.76 ▼1.35
Dashboard /wp-admin2,201 ▲215.53 ▼0.0884.65 ▼9.4240.02 ▼6.45
Posts /wp-admin/edit.php2,107 ▲72.00 ▲0.0141.02 ▲1.6437.64 ▲2.99
Add New Post /wp-admin/post-new.php1,551 ▲623.56 ▲0.36681.87 ▼3.7165.36 ▼7.51
Media Library /wp-admin/upload.php1,406 ▲64.31 ▲0.12115.64 ▼3.3247.08 ▼2.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/respek-nature/templates/admin/respek_manual.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'respek_nature\\Inc\\Base\\BaseController' not found in wp-content/plugins/respek-nature/inc/Base/Enqueue.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/respek-nature/templates/respek_button_template_default.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'respek_nature\\Inc\\Base\\BaseController' not found in wp-content/plugins/respek-nature/inc/Api/Callbacks/ManagerCallbacks.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/respek-nature/templates/admin/respek_settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/respek-nature/templates/admin/respek_impact_template.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'respek_nature\\Inc\\Base\\BaseController' not found in wp-content/plugins/respek-nature/inc/Api/Callbacks/AdminCallbacks.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/respek-nature/respek-autoloader.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function respek_nature\\add_action() in wp-content/plugins/respek-nature/respek_nature.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/respek-nature/templates/respek_popup_template_default.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% 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: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

respek-nature/respek_nature.php 85% from 13 tests

"ReSpek Nature" version 1.0.45'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:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("respek-nature.php" instead of "respek_nature.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
Everything looks great! No dangerous files found in this plugin21,128 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JSON30017,420
PHP173021691,334
CSS3121711,214
PO File5270430575
JavaScript75469557
SVG10013
Sass10113
Bourne Shell1012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity9.50
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods81
▷ Static methods1518.52%
▷ Public methods7592.59%
▷ Protected methods00.00%
▷ Private methods67.41%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 1.18MB with 0.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/leaf.png15.15KB8.44KB▼ 44.25%
images/respek_logo_dark.png60.84KB17.50KB▼ 71.24%
assets/banner-1544x500.png786.97KB285.01KB▼ 63.78%
assets/banner-772x250.png245.75KB82.97KB▼ 66.24%
images/respek_logo_white.png58.96KB17.02KB▼ 71.14%