84% novinhub

Code Review | Novinhub

WordPress plugin Novinhub scored 84% from 54 tests.

About plugin

  • Plugin page: novinhub
  • Plugin version: 0.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: Mar 14, 2021
  • Latest release: Jan 24, 2022
  • Number of updates: 15
  • Update frequency: every 21.3 days
  • Top authors: novinhub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,803 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.76MB] [CPU: ▲4.55ms] Passed 4 tests

Analyzing server-side resources used by Novinhub
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7645.06 ▲4.80
Dashboard /wp-admin4.06 ▲0.7654.47 ▲9.86
Posts /wp-admin/edit.php4.17 ▲0.8254.83 ▲3.46
Add New Post /wp-admin/post-new.php6.66 ▲0.7894.75 ▲0.06
Media Library /wp-admin/upload.php3.98 ▲0.7547.28 ▲14.67

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Novinhub
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲4413.35 ▼1.331.79 ▼0.3743.59 ▲4.28
Dashboard /wp-admin2,209 ▲185.83 ▼0.04102.67 ▼14.2569.72 ▲26.75
Posts /wp-admin/edit.php2,104 ▲152.00 ▼0.0534.41 ▼8.0632.37 ▼3.20
Add New Post /wp-admin/post-new.php1,557 ▲2223.32 ▲0.42675.52 ▲90.9338.69 ▼9.64
Media Library /wp-admin/upload.php1,394 ▲94.19 ▲0.0299.78 ▼2.0372.31 ▲29.59

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 56× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Cannot declare class ArithmeticError, because the name is already in use in wp-content/plugins/novinhub/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/promises/src/CancellationException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/novinhub/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/Response.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/PumpStream.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/novinhub/vendor/guzzlehttp/psr7/src/Request.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: novinhub, scheduled publish, publish to social media

novinhub/novinhub.php Passed 13 tests

This is the main PHP file of "Novinhub" version 0.0.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
76 characters long description:
Novinhub wordpress plugin for sending wordpress posts to your social medias.

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected34,897 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
PHP1652,5887,15228,652
Markdown161,16903,521
JSON13001,331
JavaScript34544579
CSS211920453
YAML6393176
PO File17189166
Dockerfile18010
make1409

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity14.81
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces20
Interfaces16
Traits2
Classes105
▷ Abstract classes00.00%
▷ Concrete classes105100.00%
▷ Final classes2523.81%
Methods793
▷ Static methods16721.06%
▷ Public methods65282.22%
▷ Protected methods40.50%
▷ Private methods13717.28%
Functions177
▷ Named functions8749.15%
▷ Anonymous functions9050.85%
Constants166
▷ Global constants4828.92%
▷ Class constants11871.08%
▷ Public constants118100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
18 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/gap.png0.85KB0.88KB0.00%
assets/images/youtube.png0.44KB0.44KB0.00%
assets/images/twitter.png1.18KB0.48KB▼ 59.34%
assets/images/telegram.png0.53KB0.39KB▼ 27.07%
assets/images/aparat.png1.38KB0.52KB▼ 62.17%