67% xml-sitemap-generator

Code Review | Xml Sitemap Generator

WordPress plugin Xml Sitemap Generator scored 67% from 54 tests.

About plugin

  • Plugin page: xml-sitemap-gener...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 23, 2013
  • Latest release: Aug 14, 2013
  • Number of updates: 5
  • Update frequency: every 34.6 days
  • Top authors: RenaudMG (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

800+ active / 24,454 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.91MB] [CPU: ▼33.97ms] Passed 4 tests

An overview of server-side resources used by Xml Sitemap Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.60 ▼3.84
Dashboard /wp-admin3.04 ▼0.2722.01 ▼29.53
Posts /wp-admin/edit.php3.04 ▼0.3223.23 ▼26.22
Add New Post /wp-admin/post-new.php3.04 ▼2.8522.98 ▼66.12
Media Library /wp-admin/upload.php3.04 ▼0.1919.80 ▼14.00
Xml Sitemap Generator /wp-admin/plugins.php?page=xml-sitemap-generator/wp-xml-sitemap-generator.php3.0422.56

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

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

Browser metrics Passed 4 tests

Xml Sitemap Generator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.29 ▼1.004.63 ▲2.8238.88 ▼5.20
Dashboard /wp-admin2,213 ▲254.83 ▼0.05109.72 ▼2.8542.61 ▼3.23
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0136.45 ▼3.9534.44 ▼0.53
Add New Post /wp-admin/post-new.php1,536 ▲223.25 ▼0.04682.47 ▲86.5968.13 ▲15.94
Media Library /wp-admin/upload.php1,395 ▲134.23 ▼0.01101.99 ▼1.9943.29 ▼1.41
Xml Sitemap Generator /wp-admin/plugins.php?page=xml-sitemap-generator/wp-xml-sitemap-generator.php6781.537.1722.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=xml-sitemap-generator/wp-xml-sitemap-generator.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/plugins.php?page=xml-sitemap-generator/wp-xml-sitemap-generator.php
    • > Error in wp-content/plugins/xml-sitemap-generator/wp-xml-sitemap-generator.php+277
    Uncaught Error: Call to undefined function mysql_get_server_info() in wp-content/plugins/xml-sitemap-generator/wp-xml-sitemap-generator.php:277
    Stack trace:
    #0 wp-content/plugins/xml-sitemap-generator/wp-xml-sitemap-generator.php(68): wp_xml_sitemap_generator->install()
    #1 wp-includes/class-wp-hook.php(310): wp_xml_sitemap_generator->home_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/plugins.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/xml-sitemap-generator/wp-xml-sitemap-generator.php:325

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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 to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === xml-sitemap-generator === )
  • Screenshots: A description for screenshot #0 is missing in xml-sitemap-generator/assets to your readme.txt
  • Screenshots: Screenshot #1 (Easiest than easy : set up your options and click the Go Baby button to create a sitemap.xml file) image required
The official readme.txt might help

xml-sitemap-generator/wp-xml-sitemap-generator.php 92% from 13 tests

The primary PHP file in "Xml Sitemap Generator" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("xml-sitemap-generator.php" instead of "wp-xml-sitemap-generator.php")

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
Everything looks great! No dangerous files found in this plugin228 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13266228

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png23.11KB13.39KB▼ 42.07%