78% elespare

Code Review | Elespare - News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder)

WordPress plugin Elespare - News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder) scored78%from 54 tests.

About plugin

  • Plugin page: elespare
  • Plugin version: 2.0.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 30, 2021
  • Latest release: Sep 4, 2023
  • Number of updates: 17
  • Update frequency: every 44.0 days
  • Top authors: elespare (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

10,000+ active /114,850 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼8.39ms] Passed 4 tests

This is a short check of server-side resources used by Elespare - News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.13 ▼1.93
Dashboard /wp-admin3.45 ▲0.1046.48 ▼22.55
Posts /wp-admin/edit.php3.56 ▲0.2049.28 ▲0.92
Add New Post /wp-admin/post-new.php6.03 ▲0.1484.54 ▼9.98
Media Library /wp-admin/upload.php3.37 ▲0.1440.60 ▲3.70
Getting Started /wp-admin/admin.php?page=elespare_dashboard3.3330.59

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 203 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
elespare_upgrade_notice_start_time
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Elespare - News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲13113.25 ▼1.051.88 ▲0.0145.18 ▲2.94
Dashboard /wp-admin2,283 ▲955.84 ▼0.0297.32 ▼21.9741.25 ▼3.94
Posts /wp-admin/edit.php2,165 ▲762.08 ▲0.0238.86 ▼0.9435.99 ▲1.12
Add New Post /wp-admin/post-new.php1,564 ▲5023.53 ▲5.86695.13 ▲14.8760.42 ▼2.68
Media Library /wp-admin/upload.php1,468 ▲834.23 ▼0.0298.30 ▼2.3142.69 ▼1.89
Getting Started /wp-admin/admin.php?page=elespare_dashboard1,6212.0227.4773.27

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

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/elespare/inc/init.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function reviewnews_get_option() in wp-content/plugins/elespare/header-footer/templates/compat/reviewnews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function morenews_get_option() in wp-content/plugins/elespare/header-footer/templates/compat/morenews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function chromenews_get_option() in wp-content/plugins/elespare/header-footer/templates/compat/chromenews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_content() in wp-content/plugins/elespare/header-footer/templates/content/content-header.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/elespare/header-footer/templates/compat/elespare.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_content() in wp-content/plugins/elespare/header-footer/templates/content/content-footer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function darknews_get_option() in wp-content/plugins/elespare/header-footer/templates/compat/darknews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function covernews_get_option() in wp-content/plugins/elespare/header-footer/templates/compat/covernews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/elespare/header-footer/templates/default/header.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/elespare/header-footer/templates/hf.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
You can take inspiration from this readme.txt

elespare/elespare.php Passed 13 tests

The entry point to "Elespare - News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder)" version 2.0.3 is a PHP file that has certain tags in its header comment area
96 characters long description:
News, Magazine and Blog Addons for Elementor (Free Widgets, Templates and Header/Footer Builder)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin47,030 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP563,8462,12922,572
CSS71,2426618,024
JavaScript101,0199063,946
Sass133211,605
SVG34025520
JSON4900363

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 241)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.66
▷ Minimum class complexity1.00
▷ Maximum class complexity251.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity241.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes12.63%
Methods392
▷ Static methods164.08%
▷ Public methods20953.32%
▷ Protected methods8421.43%
▷ Private methods9925.26%
Functions34
▷ Named functions3088.24%
▷ Anonymous functions411.76%
Constants9
▷ Global constants555.56%
▷ Class constants444.44%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.76MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/svg/elespare-responsive.png324.41KB102.07KB▼ 68.54%
header-footer/inc/admin/svg/elespare1.png21.47KB19.22KB▼ 10.51%
header-footer/elespare.png21.47KB19.22KB▼ 10.51%
header-footer/inc/admin/svg/elespare-responsive.png324.41KB102.07KB▼ 68.54%
inc/admin/svg/elespare.png22.61KB9.14KB▼ 59.55%