84% light-xml-sitemap

Code Review | Light-XML Sitemap

WordPress plugin Light-XML Sitemap scored84%from 54 tests.

About plugin

  • Plugin page: light-xml-sitemap
  • Plugin version: 2.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2022
  • Latest release: Sep 8, 2023
  • Number of updates: 77
  • Update frequency: every 4.0 days
  • Top authors: neoslab (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /2,254 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.18ms] Passed 4 tests

Analyzing server-side resources used by Light-XML Sitemap
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0643.11 ▼2.48
Dashboard /wp-admin3.37 ▲0.0656.85 ▲2.19
Posts /wp-admin/edit.php3.48 ▲0.1253.58 ▲5.53
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.57 ▼2.50
Media Library /wp-admin/upload.php3.29 ▲0.0636.40 ▲2.08
Light-XML Sitemap /wp-admin/options-general.php?page=light-xml-sitemap-admin3.3231.96

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
_light_xml_sitemap

Browser metrics Passed 4 tests

This is an overview of browser requirements for Light-XML Sitemap
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.34 ▼0.381.90 ▼0.0443.86 ▲0.07
Dashboard /wp-admin2,199 ▲255.53 ▼0.1392.09 ▲1.4638.71 ▼7.29
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0435.07 ▼4.7834.44 ▼2.20
Add New Post /wp-admin/post-new.php1,529 ▼623.25 ▲5.09617.30 ▼36.4859.11 ▼7.12
Media Library /wp-admin/upload.php1,404 ▲14.20 ▲0.0999.15 ▼7.0243.59 ▲1.43
Light-XML Sitemap /wp-admin/options-general.php?page=light-xml-sitemap-admin1,0242.0024.7956.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/light-xml-sitemap/admin/partials/light-xml-sitemap-admin-options.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/light-xml-sitemap/public/partials/light-xml-sitemap-public-display.php:13

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)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (A general view of the plugin "options" page.)
You can take inspiration from this readme.txt

light-xml-sitemap/light-xml-sitemap.php Passed 13 tests

"Light-XML Sitemap" version 2.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
125 characters long description:
Light-XML Sitemap dynamically creates dynamic XML Sitemap that comply with Google, Bing, Yahoo! and Ask.com Sitemap protocol.

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin1,590 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS311844737
PHP12127534728
XSLT20099
JavaScript21026

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity3.71
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png68.85KB18.70KB▼ 72.85%