greben99
Forum Replies Created
-
Forum: Plugins
In reply to: [WPNewsman Lite] Changing Table PrefixThanks Alex, that’s perfect!! I will use BackupBuddy next time.
For now I’ll just update the prefixes in the table!
Thanks for your quick response.
Cheers,
ChrisForum: Plugins
In reply to: [WPNewsman Lite] Changing Table PrefixBy website prefix I mean the database prefix so I changed ours from say ‘bc_’ to ‘bt_’ but its still looking for the table ‘bc_newsman’
Forum: Plugins
In reply to: [SEO Facebook Comment] Performance Issue (fbAddComment )I forgot to add, I pulled out all the logic that adds the facebook comments and created the function –> public function addFacebookCommentsToDB($postUrl, $postId) {
A different approach that I actually changed, because I had issues with caching and scheduled events.
I added a meta value to the post, which then a scheduled task picks it up and performs the logic on it…
for example
in fbAddComments instead of calling schedule_single_event call this
update_post_meta($postId, ‘seofb_checkcomments’, $postUrl);
then somewhere else you add the following scheduled task that finds any post with that meta_key, does the add facebook stuff and then deletes the meta_key
add_action(‘icb_seofb_addcomments’, array($this, ‘seofb_add_comments’));
add_action(‘init’, array($this, ‘seofb_setup_schedule’));public function seofb_setup_schedule() {
if (!wp_next_scheduled( ‘icb_seofb_add_comment_facebook’ ) && !defined(‘WP_INSTALLING’)) {
wp_schedule_event(time(), ’10mins’, ‘icb_seofb_add_comment_facebook’);
}
}function seofb_add_comments() {
$args = array(
‘post_type’ => ‘any’,
‘post_status’ => ‘publish’,
‘post_parent’ => ”,
‘posts_per_page’ => 9999,
‘meta_query’ => array(
array(
‘key’ => ‘seofb_checkcomments’,
‘value’ => ”,
‘compare’ => ‘!=’
)
)
);$pages_to_check = get_posts($args);
foreach($pages_to_check as $queue_page) {
$option_value = get_post_meta($queue_page->ID, ‘seofb_checkcomments’, true);
//Double check the email still hasn’t been sent!!
if (!$option_value) {
return;
}do_action(“SEOFacebook_AddComToDB”, $option_value, $queue_page->ID);
delete_post_meta($queue_page->ID, ‘seofb_checkcomments’);
}
}Forum: Plugins
In reply to: [SEO Facebook Comment] Performance Issue (fbAddComment )Hi Bemcapez,
Sorry about the delay, been busy!
Just digging through my code seeing what changes I made.
The general vibe of it is I make the call to the AddFacebooktoDB function in the scheduled tasks, so delay it by say 5 minutes. (you could do it instantly, but I delay by 5 minutes just incase that page is getting hammered, only 1 event will be created every 5 minutes (could make it more)
I initially I added this to the public function __construct()
add_action( ‘SEOFacebook_AddComToDB’, array( &$this, ‘addFacebookCommentsToDB’ ), 10, 2);
and then in
public function fbAddComment($postUrl = ”, $postId = ”)I have added
wp_schedule_single_event(time()+1800, “SEOFacebook_AddComToDB”, array($postUrl, $postId));which replaced the call directly to the function addFacebookCommentsToDB()
I also added, which I think could be a good feature. Email notifications when a new facebook comment is added. As you don’t get notified by WordPress when you jam it into the database. So i added after the insert into the database. (maybe more info in the email would be good.
$wpdb->insert($this->table, $facebookCommentData);
$to = “[email protected]”;
$subject = “ALERT: New Facebook Comment Added -“.$postUrl;
$body = $cleanComment;
mail($to, $subject, $body);Hope that helps!!
Forum: Plugins
In reply to: [WPNewsman Lite] http & httpsCheers!! ??
Forum: Plugins
In reply to: [WPNewsman Lite] http & httpsIn wpnewsman.php Line 40, change
define(‘NEWSMAN_PLUGIN_URL’, WP_PLUGIN_URL.’/’.basename(dirname(__FILE__)));TO THIS…
define(‘NEWSMAN_PLUGIN_URL’, plugins_url( ‘/’, __FILE__ ));
Thanks for the plugin, love your work!!
Forum: Plugins
In reply to: [SEO Facebook Comment] Performance Issue (fbAddComment )I Fixed this problem by pulling out all the logic around syncing facebook comments with wordpress, and put that into its own function that runs on a schedule every 10 minutes, it goes through all the recent pages that have been viewed, and checks that the facebook comments are in sync. This has no impact on the users load time of a page ??
Forum: Plugins
In reply to: [WPNewsman Lite] Emails dont stop sending.The old version is 1.3.8
I did upgrade it though, when it wasn’t working hoping that the new version had the fixed bug. The version I had before that I believe was 1.0.0, as on my PC, the only 3 copies of wpnewsman I have is 1.0.0, 1.3.8, 1.4.5
Forum: Plugins
In reply to: [WPNewsman Lite] Emails dont stop sending.In addition to this, I had a look at the database structure of the one that wasn’t working with the one that was working… I noticed 2 differences. I made those 2 changes to wpnewsman that wasn’t working, and everything is now working.
The differences were
Not working version had MUL on the recipientId in the sentLog table
| recipientId | int(10) unsigned | NO | MUL | 0
Also, in the contact list the not working version had NO for NULL whereas the new version had YES
| bounceStatus | text | NO | | NULL
Below are the table structures
FRESH INSTALL WORKING
mysql> SHOW COLUMNS FROM bc_newsman_lists;
+—————-+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————-+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| uid | varchar(255) | NO | | | |
| name | varchar(255) | NO | | | |
| tblSubscribers | varchar(255) | NO | | | |
| title | text | NO | | NULL | |
| header | text | NO | | NULL | |
| footer | text | NO | | NULL | |
| form | text | NO | | NULL | |
| extcss | text | NO | | NULL | |
+—————-+——————+——+—–+———+—————-+
9 rows in set (0.04 sec)mysql> SHOW COLUMNS FROM bc_newsman_lst_default;
+————–+———————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+————–+———————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| ts | datetime | NO | | NULL | |
| ip | varchar(50) | NO | | NULL | |
| email | varchar(255) | NO | UNI | NULL | |
| status | tinyint(3) unsigned | NO | | 0 | |
| ucode | varchar(255) | NO | | NULL | |
| fields | text | YES | | NULL | |
| bounceStatus | text | YES | | NULL | |
+————–+———————+——+—–+———+—————-+
8 rows in set (0.06 sec)mysql> SHOW COLUMNS FROM bc_newsman_sentlog;
+—————+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| emailId | int(10) unsigned | NO | MUL | NULL | |
| listId | int(10) unsigned | NO | | 0 | |
| recipientId | int(10) unsigned | NO | | 0 | |
| recipientAddr | varchar(255) | NO | | | |
| statusMsg | text | NO | | NULL | |
| errorCode | int(10) unsigned | NO | | 0 | |
+—————+——————+——+—–+———+—————-+
7 rows in set (0.01 sec)NOT WORKING VERSION
mysql> SHOW COLUMNS FROM bc_newsman_lists;
+—————-+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————-+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| uid | varchar(255) | NO | | | |
| name | varchar(255) | NO | | | |
| tblSubscribers | varchar(255) | NO | | | |
| title | text | NO | | NULL | |
| header | text | NO | | NULL | |
| footer | text | NO | | NULL | |
| form | text | NO | | NULL | |
| extcss | text | NO | | NULL | |
+—————-+——————+——+—–+———+—————-+
9 rows in set (0.00 sec)mysql> SHOW COLUMNS FROM bc_newsman_lst_default;
+————–+———————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+————–+———————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| ts | datetime | NO | | NULL | |
| ip | varchar(50) | NO | | NULL | |
| email | varchar(255) | NO | UNI | NULL | |
| status | tinyint(3) unsigned | NO | | 0 | |
| ucode | varchar(255) | NO | | NULL | |
| fields | text | YES | | NULL | |
| bounceStatus | text | NO | | NULL | |
+————–+———————+——+—–+———+—————-+
8 rows in set (0.00 sec)mysql> SHOW COLUMNS FROM bc_newsman_sentlog;
+—————+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| emailId | int(10) unsigned | NO | MUL | NULL | |
| listId | int(10) unsigned | NO | | 0 | |
| recipientId | int(10) unsigned | NO | MUL | 0 | |
| recipientAddr | varchar(255) | NO | | | |
| statusMsg | text | NO | | NULL | |
| errorCode | int(10) unsigned | NO | | 0 | |
+—————+——————+——+—–+———+—————-+
7 rows in set (0.01 sec)Forum: Plugins
In reply to: [WPNewsman Lite] Emails dont stop sending.Hey,
Sorry for the delay in getting back to you, the email you provided has been moderated.
I didn’t want to waste your time, so the questions you asked above got me thinking, and I did some testing.
I whipped up a test environment (benefits of using AWS), disabled all the other plugins, it was still happening.
I started with the original g-lock subscriber app ages ago, then moved over to wpnewsman lite, the migration didn’t work when I did it, I don’t think there was a migration at the time, so I manually had to move the contacts over. I started with the original version of wpnewsman, and have just upgraded as you have released it new versions. I thought maybe something could have been corrupted, some of the data.
I dropped all the newsman tables, disabled and enabled the newsman plugin so it setup the tables from scratch (left the options settings there) imported a test list, sent the email and it worked!
Not sure if this is related, but just noticed this error appearing in the logs sometimes…
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘FROM
bc_newsman_sentlog
\n\t\t\tWHERE \n\t\t\tbc_newsman_sentlog
.emailId
= 1 AND\n\t\t’ at line 7 for query \n\t\t\tSELECT \n\t\t\tbc_newsman_sentlog
.listId
,\n\t\t\t” as ‘listName’,\n\t\t\tbc_newsman_sentlog
.recipientId
,\n\t\t\tbc_newsman_sentlog
.statusMsg
,\n\t\t\tbc_newsman_sentlog
.recipientAddr
as ’email’,\n\t\t\tFROMbc_newsman_sentlog
\n\t\t\tWHERE \n\t\t\tbc_newsman_sentlog
.emailId
= 1 AND\n\t\t\tbc_newsman_sentlog
.recipientId
= 0 AND\n\t\t\tbc_newsman_sentlog
.errorCode
> 0\n\t\t made by do_action(‘wp_ajax_newsmanAjGetErrorLog’), call_user_func_array, newsmanAJAX->ajGetErrorLog, newsmanSentlog->getErrors, newsmanSentlog->getErrorsForList, referer: /wp-admin/admin.php?page=newsman-mailbox