62% presseportal

Code Review | Presseportal Plugin

WordPress plugin Presseportal Plugin scored62%from 54 tests.

About plugin

  • Plugin page: presseportal
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Nov 9, 2013
  • Latest release: Apr 29, 2014
  • Number of updates: 12
  • Update frequency: every 116.5 days
  • Top authors: Strunker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,536 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.08MB] [CPU: ▼38.57ms] Passed 4 tests

A check of server-side resources used by Presseportal Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6814.50 ▼28.12
Dashboard /wp-admin2.96 ▼0.3418.98 ▼27.55
Posts /wp-admin/edit.php2.96 ▼0.3920.22 ▼30.54
Add New Post /wp-admin/post-new.php2.96 ▼2.9220.28 ▼68.08
Media Library /wp-admin/upload.php2.96 ▼0.2720.29 ▼15.02
Presseportal /wp-admin/options-general.php?page=presseportal_options2.9618.67

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Presseportal Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲6213.56 ▼1.131.59 ▼0.3139.02 ▼7.80
Dashboard /wp-admin2,232 ▲475.34 ▼0.54112.19 ▼1.7840.74 ▼5.87
Posts /wp-admin/edit.php2,123 ▲372.44 ▲0.4241.25 ▲4.5635.18 ▼4.83
Add New Post /wp-admin/post-new.php1,542 ▲2123.61 ▲0.44683.08 ▼26.1836.23 ▼19.24
Media Library /wp-admin/upload.php1,420 ▲324.61 ▲0.46103.36 ▼1.4942.43 ▼3.09
Presseportal /wp-admin/options-general.php?page=presseportal_options2,2932.6636.2325.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/presseportal/options.php+46
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 84 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Notice in wp-content/plugins/presseportal/options.php+46
    Trying to access array offset on value of type bool
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/offices_companies.php+86
    Use of undefined constant PRESSEPORTAL_RESOURCE_ID - assumed 'PRESSEPORTAL_RESOURCE_ID' (this will throw an Error in a future version of PHP)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/offices_companies.php+91
    Use of undefined constant PRESSEPORTAL_RESOURCE_TYPE - assumed 'PRESSEPORTAL_RESOURCE_TYPE' (this will throw an Error in a future version of PHP)
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/cron.php+114
    Use of undefined constant PRESSEPORTAL_RESOURCE_NAME - assumed 'PRESSEPORTAL_RESOURCE_NAME' (this will throw an Error in a future version of PHP)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/offices_companies.php+125
    Use of undefined constant PRESSEPORTAL_RESOURCE_USER_ID - assumed 'PRESSEPORTAL_RESOURCE_USER_ID' (this will throw an Error in a future version of PHP)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/offices_companies.php+136
    Use of undefined constant PRESSEPORTAL_RESOURCE_CATEGORY_ID - assumed 'PRESSEPORTAL_RESOURCE_CATEGORY_ID' (this will throw an Error in a future version of PHP)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Warning in wp-content/plugins/presseportal/admin/cron.php+123
    Use of undefined constant PRESSEPORTAL_RESOURCE_LAST_STORY_ID - assumed 'PRESSEPORTAL_RESOURCE_LAST_STORY_ID' (this will throw an Error in a future version of PHP)

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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/presseportal/admin/general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/presseportal/admin/general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/presseportal/admin/offices_companies.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/presseportal/admin/cron.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/presseportal/Presseportal.php:29

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=presseportal_options
    • > Network (severe)
    wp-content/plugins/presseportal//css/Presseportal.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === presseportal === )
You can take inspiration from this readme.txt

presseportal/Presseportal.php 92% from 13 tests

This is the main PHP file of "Presseportal Plugin" version 0.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("presseportal.php" instead of "Presseportal.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
Good job! No executable or dangerous file extensions detected1,580 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP72332251,034
JavaScript23458184
PO File16470169
CSS2236101
XML30050
Ant111242

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity24.50
▷ Minimum class complexity21.00
▷ Maximum class complexity28.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods1860.00%
▷ Protected methods1136.67%
▷ Private methods13.33%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png45.97KB19.80KB▼ 56.93%
screenshot-1.png43.29KB17.89KB▼ 58.68%
screenshot-3.png53.17KB23.83KB▼ 55.18%
screenshot-2.png48.25KB21.38KB▼ 55.70%