====== Common Plugin ====== ---- plugin ---- description: Supporting classes required by some other plugins. author : Duncan Cameron type : lastupdate : 2022-08-30 compatible : phplist 3 depends : php 5.6 conflicts : similar : tags : donationurl: sourcerepo : https://github.com/bramley/phplist-plugin-common ---- This plugin provides support classes required by some other plugins. It also provides three pages which are added to the Config menu * display the output of the phpinfo() function * display the config.php file (user id and passwords are removed) * display the contents of the php session The plugin also provides options to inline CSS styles when phplist sends campaign emails, and to embed images. This plugin is now included with phplist, so you need to only enable it on the Manage Plugins page. ====== Installation ====== See the README file on the GitHub page https://github.com/bramley/phplist-plugin-common for how to install the plugin. ====== Inline CSS styles ====== The plugin provides an option to inline CSS styles when phplist builds the email content. This allows you to include '' An h3 element in the template

EPTUG public meeting

will be changed to

EPTUG public meeting

There are two packages to do the inlining that are included in the plugin - PreMailer (https://github.com/crossjoin/PreMailer), and Emogrifier (https://github.com/MyIntervals/emogrifier). You can choose which package to use, or select not to inline CSS styles, in the Campaigns group of the Settings page. {{ :plugin:inline_css.png?nolink |}} This feature requires php 7.2 or later. You should not try to use this if you are running an earlier version of php. ====== Embedding images ====== The plugin provides an option to embed images - add images as inline attachments instead of being fetched when the email is displayed. This should be used with care as it can cause the size of each email to increase dramatically. Also, the approach might work better or worse in different email clients so you should test the effect of using this option. The option is on the Settings page in the Campaign settings group {{ :plugin:embed_images.png?nolink&400 |}} This feature requires php 8, the option is not displayed for earlier versions of php. To have an image embedded you need to add a class attribute with value ''embed'' or add ''embed'' to an existing class attribute. or, if the image already has a class attribute The plugin will create a cache of images to be embedded in the directory identified by the ''$tmpdir'' setting in config.php. Ensure that the directory is writeable by the web server. ====== Logging database queries ====== There is a mechanism to log the sql queries created by most plugins. This might be useful in debugging or to be able to run a query manually. Add the following to the config.php file (at the end of the file is ok) $log_options = array( 'threshold' => 'DEBUG', 'classes' => array( 'phpList\plugin\Common\DB' => true, ), ); Now queries will be logged to a file in the phplist temporary directory, identfied by the ''$tmpdir'' variable in config.php. The file will be named for the current day, e.g. log_2018-07-13.txt. Alternatively you can specify a particular directory for the log file. The directory must be writeable by the web server process. $log_options = array( 'threshold' => 'DEBUG', 'classes' => array( 'phpList\plugin\Common\DB' => true, ), 'dir' => '/path/to/directory', ); Each query will be logged similar to this [Fri 13 Jul 2018 10:09:15] [debug] phpList\plugin\Common\DB::_query, line 39 elapsed time 11.165857315063 ms SELECT id, email, confirmed, blacklisted FROM phplist_user_user u LEFT JOIN phplist_listuser lu ON u.id = lu.userid WHERE userid is NULL To stop logging queries simply change DEBUG to OFF.