84% substack-importer

Code Review | Substack Importer

WordPress plugin Substack Importer scored 84% from 54 tests.

About plugin

  • Plugin page: substack-importer
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Dec 11, 2020
  • Latest release: Aug 11, 2023
  • Number of updates: 12
  • Update frequency: every 81.1 days
  • Top authors: jeroenpfeil (91.67%)Otto42 (16.67%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 4,861 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.00MB] [CPU: ▼2.58ms] Passed 4 tests

Analyzing server-side resources used by Substack Importer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.99 ▼2.40
Dashboard /wp-admin3.31 ▲0.0048.89 ▼0.53
Posts /wp-admin/edit.php3.36 ▲0.0045.90 ▲0.61
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.06 ▼7.99
Media Library /wp-admin/upload.php3.23 ▲0.0035.26 ▲1.61

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Substack Importer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.32 ▼1.191.68 ▲0.0841.23 ▲3.33
Dashboard /wp-admin2,209 ▲205.90 ▲0.93103.80 ▼15.7437.96 ▼9.25
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0337.26 ▼2.5932.32 ▼3.09
Add New Post /wp-admin/post-new.php1,534 ▲1423.37 ▲0.26600.43 ▼38.2348.23 ▼5.74
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0895.48 ▲0.3440.95 ▲0.38

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/substack-importer/partials/container.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/substack-importer/partials/start-screen.php:2
    • > PHP Notice
      Undefined variable: wp_importer in wp-content/plugins/substack-importer/partials/pre-import-screen.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/substack-importer/partials/progress.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function import_options() on null in wp-content/plugins/substack-importer/partials/pre-import-screen.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: substack, importer

substack-importer/substack-importer.php Passed 13 tests

This is the main PHP file of "Substack Importer" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
74 characters long description:
A plugin that lets you import content from Substack to your WordPress site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected2,531 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP225829812,009
JSON210471
CSS17032
JavaScript15019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity22.50
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods137
▷ Static methods1913.87%
▷ Public methods7353.28%
▷ Protected methods5137.23%
▷ Private methods139.49%
Functions8
▷ Named functions225.00%
▷ Anonymous functions675.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png5.55KB2.07KB▼ 62.72%