78% simple-newsletter-generator

Code Review | Tiedotuspostigeneraattori

WordPress plugin Tiedotuspostigeneraattori scored78%from 54 tests.

About plugin

  • Plugin page: simple-newsletter...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.3
  • WordPress version: 6.3.1
  • First release: Jun 23, 2015
  • Latest release: Aug 18, 2015
  • Number of updates: 22
  • Update frequency: every 2.7 days
  • Top authors: Tysss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /684 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.54MB] [CPU: ▼16.64ms] Passed 4 tests

Analyzing server-side resources used by Tiedotuspostigeneraattori
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.1346.38 ▼1.56
Dashboard /wp-admin3.77 ▲0.1452.16 ▼15.37
Posts /wp-admin/edit.php3.82 ▲0.1452.39 ▼1.42
Add New Post /wp-admin/post-new.php3.56 ▼2.5941.61 ▼48.20
Media Library /wp-admin/upload.php3.63 ▲0.1443.10 ▲2.05
Newsletter messages /wp-admin/edit.php?post_type=tiedotettavat3.6741.40
Newsletter settings /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotuksen-asetukset3.5836.59
Subjects /wp-admin/edit-tags.php?taxonomy=tiedotusaihe&post_type=tiedotettavat3.6338.75
Generator /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotusgeneraattori3.5939.19
Add New /wp-admin/post-new.php?post_type=tiedotettavat3.5534.75

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Tiedotuspostigeneraattori: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲11014.48 ▲0.551.93 ▲0.1944.79 ▲5.43
Dashboard /wp-admin2,231 ▲505.60 ▼0.1185.51 ▼18.0138.70 ▼1.67
Posts /wp-admin/edit.php2,139 ▲422.01 ▼0.0139.96 ▲3.6636.49 ▲0.32
Add New Post /wp-admin/post-new.php1,583 ▲5718.21 ▲0.60625.92 ▼61.6649.70 ▼3.46
Media Library /wp-admin/upload.php1,439 ▲364.19 ▼0.0398.86 ▼5.1241.91 ▼4.28
Newsletter messages /wp-admin/edit.php?post_type=tiedotettavat1,1001.9832.5432.54
Newsletter settings /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotuksen-asetukset9112.0221.9432.82
Subjects /wp-admin/edit-tags.php?taxonomy=tiedotusaihe&post_type=tiedotettavat1,3162.1426.9529.59
Generator /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotusgeneraattori7872.0525.7822.90
Add New /wp-admin/post-new.php?post_type=tiedotettavat2,3357.64173.5961.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotusgeneraattori
    • > Notice in wp-content/plugins/simple-newsletter-generator/tiedotuspostigeneraattori.php+172
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/edit.php?post_type=tiedotettavat&page=tiedotusgeneraattori
    • > Warning in wp-content/plugins/simple-newsletter-generator/tiedotuspostigeneraattori.php+174
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/post-new.php?post_type=tiedotettavat
    • > Notice in wp-content/plugins/simple-newsletter-generator/tiedotuspostigeneraattori.php+110
    Undefined index: tiedotettavameta_noncename
    • > GET request to /wp-admin/post-new.php?post_type=tiedotettavat
    • > Warning in wp-content/plugins/simple-newsletter-generator/tiedotuspostigeneraattori.php+82
    Use of undefined constant Ymd - assumed 'Ymd' (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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/simple-newsletter-generator/asetukset.php:313
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-newsletter-generator/tiedotuspostigeneraattori.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: email, tiedottaminen, mailing list, mail generator

simple-newsletter-generator/tiedotuspostigeneraattori.php 92% from 13 tests

"Tiedotuspostigeneraattori" version 0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-newsletter-generator.php" instead of "tiedotuspostigeneraattori.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin610 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP216195510
PO File13844100

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin