WordPress plugins to remember
https://wordpress.org/plugins/duplicator/ The Duplicator gives WordPress administrators the ability to migrate, copy or clone a site from one location to another. The plugin also serves as a simple backup utility. The…
https://wordpress.org/plugins/duplicator/ The Duplicator gives WordPress administrators the ability to migrate, copy or clone a site from one location to another. The plugin also serves as a simple backup utility. The…
Creating URL Old way (Yii 1.0 maybe??) $url = Yii::$app->controller->createUrl('xx');// your own url generation logic New way (Yii 2.0 ) $url = \Yii::$app->getUrlManager()->createUrl('consignment/label'); Creating controllers Debugging (old skool) Yii::info("My message"…
Search /home/awstats/DirData/ for any files relating to the domain you're dealing with and are newer than those for which you have logs. eg... ll /home/awstats/DirData/awstats*.www.example.com.txt ll /home/awstats/DirData/awstats*2015.www.example.com.txt and then either remove them…
Installing WordFence #1 #2 gives you protection and great visibility into whats going on. It's easy to think no problems = no attacks, but after installing WordFence it was immediately obvious…
ALTER TABLE `tablename` ADD COLUMN `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD COLUMN `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html https://dev.mysql.com/doc/refman/5.6/en/data-type-defaults.html Requires MySQL 5.6.5 or better
mysqldump-script-for-windows mysqldump.exe --defaults-file=mysqldump.cnf --all-databases -h 192.168.1.22 > backup-%date:~6,4%-%date:~3,2%-%date:~0,2%-%time:~0,2%%time:~3,2%%time:~6,2%.sql Produces filename like backup-2015-08-27-160938.sql
Generate private key openssl genrsa -out domainname.key 2048 Generate Signing Request openssl req -new -key domainname.key -out domainname.csr
Use WP-CLI (http://wp-cli.org/) Su to a non-privileged user # su -m www # wp core version 4.2.2 # wp core verify-checksums Success: WordPress install verifies against checksums. # wp core…
Original script at https://www.howtoforge.com/how-to-find-outdated-wordpress-versions-on-your-server-to-reduce-the-risk-of-being-hacked This script has been improved to automatically detect latest Wordpress version by sending a HTTP HEAD request to http://wordpress.org/latest and parsing the Content-Disposition: attachment; filename=wordpress-A.B.C.tar.gz result as suggested at https://wordpress.org/support/topic/programmatically-check-latest-wp-release <?php /**…
The single command approach mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname make sure you can ... mysql -h newhost -u newusername -pnewpassword…
Getting Fatal error: Call to undefined function geoip_country_name_by_name() ? Install /usr/ports/net/pecl-geoip # cd /usr/ports/net/pecl-geoip && make install clean # "/usr/local/www/awstats/cgi-bin/awstats.pl" -update -config=account.ptiexpress.com -configdir="/usr/local/etc/awstats/" Error: Plugin load for plugin 'geoipfree' failed…
Error logs were filling up with these.... [core:notice] [pid 1282] AH00052: child pid 29796 exit signal Segmentation fault (11) Web visitors where shown... --- No data received Unable to load…
my.cnf file. Try and use this before you start MySQL Server for the first time! [mysqld] log-output=TABLE expire_logs_days=1 general_log=ON general_log_file=/var/db/mysql/mysqld-queries.log slow_query_log=ON slow_query_log_file=/var/db/mysql/mysqld-slow-queries.log log_queries_not_using_indexes=ON log-error=/var/db/mysql/mysqld-error.log default-storage-engine=innodb innodb_file_per_table Run the following SQL…
CREATE DEFINER=`root`@`localhost` FUNCTION `FIND_DISTANCE`(`src_latitude` float,`src_longitude` float, `dest_latitude` float,`dest_longitude` float) RETURNS int(11) BEGIN /* This function takes four parameterss, two sets of latitude and latitude pairs and returns the distance between…
[mysqld] ... log-output=TABLE expire_logs_days=1 general_log=1 general_log_file=/var/log/mysqld-queries.log slow_query_log=1 slow_query_log_file=/var/log/mysqld-slow-queries.log ... SET @old_log_state = @@global.general_log; SET GLOBAL general_log = 'OFF'; ALTER TABLE mysql.general_log ENGINE = MyISAM; SET GLOBAL general_log = @old_log_state;…
// You may need to update the table names if a Wordpress table prefix has been set. INSERT INTO wp_users (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES…
Despite turning on errors in php.ini I wasn't getting any error messages when I went to http://ipaddress/lists/ or http://ipaddress/lists/admin/, I just received a white screen of death. After adding error_log() statements thoughout the code…
If you see random ’ characters or similar on your Wordpress site its likely to be an encoding mismatch between your Wordpress installation and your MySQL database server. I did the…
DROP FUNCTION IF EXISTS `degree2decimal`; CREATE DEFINER = `root`@`localhost` FUNCTION `degree2decimal`(deg_coord float) RETURNS float BEGIN #converts NMEA/GPS Lat -Long to Decimal Degrees. Code comments are self explanatory. #The code is…
http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Download : searchreplacedb21
<?php $meta_values = get_post_meta(get_the_ID()); $original_urls = ''; foreach ($meta_values['original_url'] as $url) { $original_urls .= "Original URL : <a href=\"$url\">$url</a><br />"; } ?> <?php print "<small>$original_urls</small><br />"; ?>
SSL and Cookies in WordPress 2.6 HOWTO: Set up secret keys in WordPress 2.6+ Secret Key Generator
<?php $i = new mysqli('localhost', 'username', 'password', 'database'); if ($result = $i->query("SELECT * FROM tablename;") ) { printf("Select returned %d rows.\n", $result->num_rows); if ($result->num_rows > 0) { while ($row =…
http://www.phpclasses.org/browse/file/10489.html
http://www.fpdf.org/ (Used on PTI and JMS) http://www.ros.co.nz/pdf/ Never used, but looks interesting.