78% post-to-flarum

Code Review | Post to Flarum

WordPress plugin Post to Flarum scored 78% from 54 tests.

About plugin

  • Plugin page: post-to-flarum
  • Plugin version: 0.3.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 5.8.1
  • First release: Jul 21, 2020
  • Latest release: Oct 23, 2020
  • Number of updates: 13
  • Update frequency: every 7.2 days
  • Top authors: malago (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 362 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.88MB] [CPU: ▼185.76ms] Passed 4 tests

Analyzing server-side resources used by Post to Flarum
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.75 ▼0.975.41 ▼17.02
Dashboard /wp-admin1.77 ▼1.286.24 ▼36.60
Posts /wp-admin/edit.php1.77 ▼1.345.58 ▼34.61
Add New Post /wp-admin/post-new.php1.77 ▼3.665.48 ▼647.00
Media Library /wp-admin/upload.php1.77 ▼1.235.76 ▼24.84
Post to Flarum /wp-admin/tools.php?page=postToFlarum1.774.63

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 33 new files
Database: 2 new tables, 1 new option
New tables
wp_posttoflarum_posts
wp_posttoflarum
New WordPress options
_posttoflarum_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Post to Flarum
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,690 ▲9415.99 ▲0.369.60 ▼1.1750.85 ▲4.19
Dashboard /wp-admin2,974 ▲435.90 ▼0.05137.06 ▼11.28109.25 ▼2.94
Posts /wp-admin/edit.php2,746 ▲72.72 ▲0.0174.87 ▲8.8198.58 ▲7.90
Add New Post /wp-admin/post-new.php1,688 ▲18818.54 ▼0.31363.99 ▼25.45115.87 ▲4.30
Media Library /wp-admin/upload.php1,814 ▲45.04 ▲0.01153.24 ▲3.58117.68 ▲4.00
Post to Flarum /wp-admin/tools.php?page=postToFlarum1,1922.1061.4278.92

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the postToFlarum_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=postToFlarum
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the postToFlarum_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/tools.php?page=postToFlarum
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/EmphasisConverter.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/DefaultConverter.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/ListBlockConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/BlockquoteConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/LinkConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/HardBreakConverter.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/CodeConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Markdownify\\Converter' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/ConverterExtra.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/ImageConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/post-to-flarum/htmltomarkdown/Converter/ParagraphConverter.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes: Please take inspiration from this readme.txt

post-to-flarum/postToFlarum.php 92% from 13 tests

"Post to Flarum" version 0.3.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("post-to-flarum.php" instead of "postToFlarum.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,995 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP296131,4072,956
Markdown217036
CSS1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.07
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces3
Interfaces4
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes14.17%
Methods184
▷ Static methods10.54%
▷ Public methods9853.26%
▷ Protected methods7339.67%
▷ Private methods137.07%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin