To test if Contact Form 7 is running, we use the following code to see if the WPCF7_VERSION is defined. If the plugin is loaded, this will return with a value, which is TRUE.
<?php
if( defined( ‘WPCF7_VERSION’ )
{
// code block here
}
?>
To test if Contact Form 7 is running, we use the following code to see if the WPCF7_VERSION is defined. If the plugin is loaded, this will return with a value, which is TRUE.
<?php
if( defined( ‘WPCF7_VERSION’ )
{
// code block here
}
?>
Recently we installed Odoo 9 Community Edition on a fresh Ubuntu server. When attempting to print a sales order, which creates a pdf version, it was creating a 0kb empty file. After attempting to update to various newer versions of wkhtmltopdf, we were able to resolve the issue. We ended up using whtmltopdf 0.12.2 version which resolved the issue for us.
Download the correct wkhtmltopdf 0.12.3 package your Ubuntu install (32 vs 64 bit) from http://download.gna.org/wkhtmltopdf/0.12/0.12.2/ . We use 64 bit version.
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-wheezy-amd64.deb
Install the package:
dpkg -i wkhtmltox-0.12.2_linux-wheezy-amd64.deb
Install dependencies:
apt-get -f install
Create symlinks in /usr/bin folder:
ln -s /usr/bin/local/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/bin/local/wkhtmltoimage /usr/bin/wkhtmltoimage
A recent update to Plesk ProFTPd package version 1.3.6-8.el6.art left ftp connectivity broken on a Plesk Panels 11.5.3 on CentOS 6.5 server. The update appended the following line to the tail of the /etc/proftpd.conf config file:
Include /etc/proftpd.d/*.conf
However, on the problematic server, the /etc/proftpd.d/ directory did not exist. The log file /var/log/messages was showing the following errors when attempting to start the xinetd service that runs ProFTPd.
Sep 8 11:30:54 triton xinetd[5803]: START: ftp pid=6085 from=::1
Sep 8 11:30:54 triton proftpd[6085]: error: cannot read configuration path ‘/etc/proftpd.d’: Not a directory
Sep 8 11:30:54 triton proftpd[6085]: fatal: Include: error including ‘/etc/proftpd.d/*.conf’: Invalid argument on line 95 of ‘/etc/proftpd.conf’
Sep 8 11:30:54 triton xinetd[5803]: EXIT: ftp status=1 pid=6085 duration=0(sec)
The simple solution is to comment the line out in the config file or create the /etc/proftpd.d/ directory.
The Belkin Thunderbolt Express dock uses a Fresco Logic xHCI (USB3) Controller FL1100 Series chipset when used with Windows 7 or 8.
The driver that will allow the Belkin Express Dock to work with windows 7 can be downloaded from HP’s website via sp59929.exe which can be obtained from this page: http://h20565.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdDetails/?cc=us&swItem=ob_112771_1
Hardware IDs found in the device manager:
PCI\VEN_1B73&DEV_1100&SUBSYS_0055050D&REV_01
PCI\VEN_1B73&DEV_1100&SUBSYS_0055050D
PCI\VEN_1B73&DEV_1100&CC_0C0330
PCI\VEN_1B73&DEV_1100&CC_0C03
If you happened to have migrated content from an older database to a new version, you might have come across some odd characters like — or ’. This was most likely due to the change if charsets of your database/tables. The following code snippet can be used to replace odd characters in your database.
UPDATE ohp_posts SET post_content = CONVERT(CAST(CONVERT(post_content USING latin1) AS BINARY) USING utf8)
Resources:
Debugging Chart Mapping Windows-1252 Characters to UTF-8 Bytes to Latin-1 Characters
UPDATE wp_posts SET post_content = REPLACE(post_content, "olddomain.com", "newdomain.com") WHERE post_content LIKE '%olddomain.com%';
REPLACE(haystack, needle, replacement needle);
The use of slug-less author page permalinks are not possible without causing 404 errors on static pages. Lets see why:
Normal rewrite rules for author pages:
[author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2]
[author/([^/]+)/?$] => index.php?author_name=$matches[1]
Rewrite rules without the “/author” slug:
[([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2]
[([^/]+)/?$] => index.php?author_name=$matches[1]
The 4th line above conflicts with the rewrite rule for pages which appears last in the list of rewrite rules:
[(.?.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]
This means that any requests for pages are handled as if it was a request for an author page. A static /about page would return 404 because the system could not find an author slug of “about”.
Rewrite rules used on a wordpress blog with a standard /yerar/month/postname/ permalink structure:
[category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
[category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
[category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]
[category/(.+?)/?$] => index.php?category_name=$matches[1]
[tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
[tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
[tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2]
[tag/([^/]+)/?$] => index.php?tag=$matches[1]
[type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]
[type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]
[type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?post_format=$matches[1]&paged=$matches[2]
[type/([^/]+)/?$] => index.php?post_format=$matches[1]
[robots\.txt$] => index.php?robots=1
[.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$] => index.php?feed=old
[.*wp-app\.php(/.*)?$] => index.php?error=403
[.*wp-signup.php$] => index.php?signup=true
[.*wp-activate.php$] => index.php?activate=true
[.*wp-register.php$] => index.php?register=true
[feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]
[(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]
[page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]
[comments/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1
[comments/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1
[search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2]
[search/(.+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2]
[search/(.+)/page/?([0-9]{1,})/?$] => index.php?s=$matches[1]&paged=$matches[2]
[search/(.+)/?$] => index.php?s=$matches[1]
[author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]
[author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2]
[author/([^/]+)/?$] => index.php?author_name=$matches[1]
[([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]
[([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
[([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
[([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]
[([0-9]{4})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]
[([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]
[([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]
[([0-9]{4})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&paged=$matches[2]
[([0-9]{4})/?$] => index.php?year=$matches[1]
[[0-9]{4}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]
[[0-9]{4}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
[[0-9]{4}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[[0-9]{4}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[[0-9]{4}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
[([0-9]{4})/([0-9]{1,2})/([^/]+)/trackback/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&tb=1
[([0-9]{4})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&feed=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&feed=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&paged=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&cpage=$matches[4]
[([0-9]{4})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&page=$matches[4]
[[0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]
[[0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
[[0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[[0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[[0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
[([0-9]{4})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&cpage=$matches[3]
[([0-9]{4})/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&cpage=$matches[2]
[.?.+?/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]
[.?.+?/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1
[.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]
[.?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
[(.?.+?)/trackback/?$] => index.php?pagename=$matches[1]&tb=1
[(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]
[(.?.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]
[(.?.+?)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2]
[(.?.+?)/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2]
[(.?.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]
Your friendly URLs may be working correctly to serve /news/category/page1 for instance, but it can also serve that same page from /inde.php/news/category/page1. The problem that I found is that Google somehow indexed a large amount of pages that included /index.php/ in the URI. To fix, you simply need to Continue reading Silverstripe URL Rewrites Still Allow /index.php/ urls
This code snippet will create a function that allows you to convert an MD5 checksum into a UUID formatted string. MD5 sum lengths are 32 characters. UUID string lengths are 32 characters excluding dashes and 36 with dashes. Continue reading Create UUID from an existing MD5 sum in PHP
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort > /path/to/file.txt