83% single-post-export

Code Review | Plugin Name: Single Post Export

WordPress plugin Plugin Name: Single Post Export scored83%from 54 tests.

About plugin

  • Plugin page: single-post-export
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 23, 2022
  • Latest release: Mar 23, 2022
  • Number of updates: 3
  • Update frequency: every 6.7 days
  • Top authors: oliverhtml (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /690 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.01MB] [CPU: ▼3.01ms] Passed 4 tests

Analyzing server-side resources used by Plugin Name: Single Post Export
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.44 ▼1.51
Dashboard /wp-admin3.32 ▲0.0156.19 ▲5.30
Posts /wp-admin/edit.php3.37 ▲0.0149.37 ▼1.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.62 ▼8.45
Media Library /wp-admin/upload.php3.24 ▲0.0136.26 ▼0.79
Export Specific Posts /wp-admin/tools.php?page=htmlpost-export-tools3.2132.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Plugin Name: Single Post Export
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.22 ▼1.041.77 ▼0.0743.83 ▲0.57
Dashboard /wp-admin2,215 ▲274.88 ▼0.03118.50 ▲7.7544.70 ▲2.56
Posts /wp-admin/edit.php2,098 ▲92.05 ▲0.0435.30 ▼5.2330.89 ▼5.29
Add New Post /wp-admin/post-new.php1,536 ▲323.39 ▲0.17654.96 ▲29.7851.66 ▼0.20
Media Library /wp-admin/upload.php1,397 ▲94.14 ▼0.11107.41 ▲1.0243.89 ▼1.62
Export Specific Posts /wp-admin/tools.php?page=htmlpost-export-tools8411.7624.9927.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/single-post-export/htmexport.php on line 11
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/single-post-export/htmexport.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/single-post-export/htmexport.php on line 11

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Single Post Export === )
  • Contributors: The plugin contributors field is not present
Please take inspiration from this readme.txt

single-post-export/htmexport.php 92% from 13 tests

Analyzing the main PHP file in "Plugin Name: Single Post Export" version 1.0.0
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 ("single-post-export.php" instead of "htmexport.php")

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
No dangerous file extensions were detected1,498 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9202309869
JavaScript28814461
CSS32213167
SVG1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.38
▷ Minimum class complexity2.00
▷ Maximum class complexity45.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods41
▷ Static methods512.20%
▷ Public methods3995.12%
▷ Protected methods00.00%
▷ Private methods24.88%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/switch.png0.53KB0.64KB0.00%