10% smart-sitemap-generator

Code Review | Smart Sitemap Generator

WordPress plugin Smart Sitemap Generator scored 10% from 54 tests.

About plugin

  • Plugin page: smart-sitemap-gen...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2023
  • Latest release: Feb 16, 2023
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: Fatih Toprak (75%)optimisthub (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 596 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php+24
    A non well formed numeric value encountered

Server metrics [RAM: ▼1.71MB] [CPU: ▼51.54ms] Passed 4 tests

An overview of server-side resources used by Smart Sitemap Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.186.32 ▼33.64
Dashboard /wp-admin2.30 ▼1.008.04 ▼43.80
Posts /wp-admin/edit.php2.30 ▼1.067.87 ▼37.27
Add New Post /wp-admin/post-new.php2.30 ▼3.597.46 ▼91.45
Media Library /wp-admin/upload.php2.30 ▼0.937.78 ▼23.76
Smart Sitemap Options /wp-admin/options-general.php?page=smart-sitemap-generator2.307.42

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Sitemap Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.21 ▼1.171.74 ▼0.1735.86 ▼7.88
Dashboard /wp-admin2,210 ▲224.86 ▼0.23106.15 ▼9.1436.82 ▼7.30
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0541.53 ▲6.0237.40 ▲5.08
Add New Post /wp-admin/post-new.php1,536 ▲223.37 ▲0.38638.10 ▼33.0565.82 ▲22.66
Media Library /wp-admin/upload.php1,386 ▲14.23 ▲0.0296.42 ▼3.5639.80 ▼7.14
Smart Sitemap Options /wp-admin/options-general.php?page=smart-sitemap-generator8822.0226.7026.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php+24
    A non well formed numeric value encountered
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=smart-sitemap-generator
    • > Notice in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php+24
    A non well formed numeric value encountered
    • > GET request to /wp-admin/options-general.php?page=smart-sitemap-generator
    • > Warning in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php+25
    array_values() expects parameter 1 to be array, null given
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-sitemap-generator
    • > Notice in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap-admin.php+126
    Trying to access array offset on value of type bool
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-sitemap-generator
    • > Warning in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap-admin.php+126
    in_array() expects parameter 2 to be array, null given

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap-admin.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'samdark\\sitemap\\WriterInterface' not found in wp-content/plugins/smart-sitemap-generator/vendor/samdark/sitemap/TempFileGZIPWriter.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/smart-sitemap-generator/vendor/samdark/sitemap/tests/SitemapTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'samdark\\sitemap\\WriterInterface' not found in wp-content/plugins/smart-sitemap-generator/vendor/samdark/sitemap/DeflateWriter.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smart-sitemap-generator/includes/class.smart-sitemap.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/smart-sitemap-generator/vendor/samdark/sitemap/tests/IndexTest.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'samdark\\sitemap\\WriterInterface' not found in wp-content/plugins/smart-sitemap-generator/vendor/samdark/sitemap/PlainFileWriter.php:8

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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: xml sitemap, yandex sitemap, sitemap, google sitemap, bing sitemap...

smart-sitemap-generator/index.php 92% from 13 tests

The entry point to "Smart Sitemap Generator" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-sitemap-generator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected6,576 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP266251,3202,544
XSD420062,212
Markdown321901,204
XSLT340450
JSON100120
YAML37138
XML1008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods111
▷ Static methods1917.12%
▷ Public methods9081.08%
▷ Protected methods43.60%
▷ Private methods1715.32%
Functions79
▷ Named functions7493.67%
▷ Anonymous functions56.33%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin