87% jannes-mannes-social-media-auto-publisher

Code Review | Jannes & Mannes Social Media Auto Publisher

WordPress plugin Jannes & Mannes Social Media Auto Publisher scored 87% from 54 tests.

About plugin

  • Plugin page: jannes-mannes-soc...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 5.8.1
  • First release: Jan 24, 2017
  • Latest release: Feb 15, 2018
  • Number of updates: 28
  • Update frequency: every 13.8 days
  • Top authors: jannesmannes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 774 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.31MB] [CPU: ▼191.51ms] Passed 4 tests

Analyzing server-side resources used by Jannes & Mannes Social Media Auto Publisher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0227.13 ▼13.73
Dashboard /wp-admin3.10 ▲0.0434.22 ▼16.41
Posts /wp-admin/edit.php3.15 ▲0.0433.07 ▼2.25
Add New Post /wp-admin/post-new.php4.10 ▼1.3427.79 ▼733.65
Media Library /wp-admin/upload.php3.04 ▲0.0427.25 ▲5.03

Server storage [IO: ▲7.14MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • Illegal file modification detected: 1 file (0.31KB) outside of "wp-content/plugins/jannes-mannes-social-media-auto-publisher/" and "wp-content/uploads/"
    • (new file) wp-content/debug-2022-03-10.log
Filesystem: 2,244 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Jannes & Mannes Social Media Auto Publisher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲12415.98 ▼0.055.40 ▼0.6179.54 ▼15.76
Dashboard /wp-admin2,961 ▲676.14 ▲0.05114.38 ▼32.62166.75 ▼30.65
Posts /wp-admin/edit.php2,775 ▲353.22 ▼0.0064.89 ▼0.29135.53 ▼2.16
Add New Post /wp-admin/post-new.php3,803 ▼518.41 ▲0.89426.22 ▲15.89185.36 ▲24.43
Media Library /wp-admin/upload.php1,787 ▲385.54 ▼0.04141.89 ▲1.53190.40 ▲13.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/autoload.Problem.And.Legacy.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/files.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/index.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/legacy_examples/1.example.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/TestingFunctions.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/tests/Autoload.test.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/cookie.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/sqlite.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/tests/NewCacheInstance.test.php
    • > /wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/examples/legacy_examples/readme_legacy.php
  • 1272× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit_Framework_Test' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpunit/phpunit/src/Extensions/PhptTestCase.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/src/phpFastCache/_extensions/predis-1.0/src/Command/KeyDelete.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_Assert' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpunit/phpunit/src/Extensions/TestDecorator.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Prophecy\\Promise\\PromiseInterface' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpunit/phpunit/tests/Regression/Trac/684/Issue684Test.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\PredisException' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/src/phpFastCache/_extensions/predis-1.0/src/Transaction/AbortedMultiExecException.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit_Framework_MockObject_Matcher_Invocation' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/StatelessInvocation.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/src/phpFastCache/_extensions/predis-1.0/src/Command/ServerScript.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Prophecy\\Doubler\\ClassPatch\\ClassPatchInterface' not found in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php:24
    • > PHP Fatal error
      Uncaught Predis\\Connection\\ConnectionException: Connection refused [tcp://127.0.0.1:6379] in wp-content/plugins/jannes-mannes-social-media-auto-publisher/vendor/phpfastcache/phpfastcache/src/phpFastCache/_extensions/predis-1.0/src/Connection/AbstractConnection.php:146

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 93% 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
7 plugin tags: linkedin, twitter, social, facebook, publisher...

jannes-mannes-social-media-auto-publisher/jm-social-media-auto-publisher.php 85% from 13 tests

"Jannes & Mannes Social Media Auto Publisher" version 1.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("jannes-mannes-social-media-auto-publisher.php" instead of "jm-social-media-auto-publisher.php")
  • Description: Make the plugin description longer than 10 characters (currently 0 characters long)

Code Analysis 97% from 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
There were no executable files found in this plugin126,785 lines of code in 2,087 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,81325,10059,464109,371
Markdown823,19706,772
JSON501104,238
YAML612621143,931
XML55110281,169
Ant10910573
SVG100288
XSD100264
CSS326498
INI16624
make17022
JavaScript752120
Bourne Shell10014
HTML1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 154)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.52
▷ Minimum class complexity1.00
▷ Maximum class complexity264.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity154.00
Code structure
Namespaces168
Interfaces139
Traits15
Classes1,717
▷ Abstract classes553.20%
▷ Concrete classes1,66296.80%
▷ Final classes995.96%
Methods9,116
▷ Static methods7828.58%
▷ Public methods7,88686.51%
▷ Protected methods7668.40%
▷ Private methods4645.09%
Functions456
▷ Named functions19843.42%
▷ Anonymous functions25856.58%
Constants264
▷ Global constants207.58%
▷ Class constants24492.42%
▷ Public constants244100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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