Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
2.5k views
in Plugins by
edited by
Q2AM Simple Adverts v1.2 adding thousands and thousands lines on qa_options table

Some examples from qa_options table:

q2am_1000_enable_adverts  
q2am_1001_advert_image_url  
q2am_1001_enable_adverts  
q2am_1002_advert_image_url  
q2am_1002_enable_adverts  
q2am_1003_advert_image_url  
q2am_1003_enable_adverts  
q2am_1004_advert_image_url  
q2am_1004_enable_adverts  
q2am_1005_advert_image_url  
q2am_1005_enable_adverts  
q2am_1006_advert_image_url  
q2am_1006_enable_adverts  
q2am_1007_advert_image_url  
q2am_1007_enable_adverts  
q2am_1008_advert_image_url  
q2am_1008_enable_adverts  
q2am_1009_advert_image_url  
q2am_1009_enable_adverts  
q2am_100_advert_image_url  
q2am_100_enable_adverts  
q2am_1010_advert_image_url  
q2am_1010_enable_adverts  
q2am_1011_advert_image_url  
q2am_1011_enable_adverts  
q2am_1012_advert_image_url  
q2am_1012_enable_adverts  
q2am_1013_advert_image_url  
q2am_1013_enable_adverts  
q2am_1014_advert_image_url  
q2am_1014_enable_adverts  
q2am_1015_advert_image_url  
q2am_1015_enable_adverts  
q2am_1016_advert_image_url  
q2am_1016_enable_adverts  
q2am_1017_advert_image_url  
q2am_1017_enable_adverts  
q2am_1018_advert_image_url  
q2am_1018_enable_adverts  
q2am_1019_advert_image_url  
q2am_1019_enable_adverts  
q2am_101_advert_image_url  
q2am_101_enable_adverts  
...

 

Thousands thousands of them

What should we do????

Thanks
Q2A version: 1.7.3
by
I will fix the issue and will update in couple of days.

@scott, Thanks for providing possible solution. It will helps.

2 Answers

+2 votes
by

We just ran across this issue in this question. The problem is the plugin checks for options using the question ID, so it adds an option for every question on your site. I've submitted an issue on the Github repo so hopefully q2amarket will fix it soon.

If you are no longer using the plugin, you can delete those options. These 2 queries will do it:

DELETE FROM `qa_options` WHERE title LIKE '%_enable_adverts';
DELETE FROM `qa_options` WHERE title LIKE '%_advert_image_url';

However, if you are still using it they will come back as soon as a question is viewed. In that case, I think it can be fixed by changing line 104 in qa-adverts-layer.php to this:

$template = $this->template;

Then delete the options as above. Make sure to backup first, and make a note of which ads you added yourself as they would be deleted with that query as well.

by
You are saying change this
        $template = qa_request() == '' ? 'home' : qa_request_part(0);
to this
        $template = $this->template;
right?
by
edited by
Scott, also adding below to every question SEO URL in that table

q2am_11-what-is-popup_advert_image_

what's going on: plugin adding a line but sometimes you see that advert_image at the end depends on how long is the title of the question
tons of these too...
by
> You are saying change this...

Yes, that's the right thing to change.

Not sure about your second comment, what is your site?
+1 vote
by
I have fixed code as Scott suggested. However, I couldn't reproduce the issue. You can download from Q2A Market Store or Github

http://store.q2amarket.com/q2a-free-plugins/simple-advert

https://github.com/q2amarket/q2am-simple-adverts

Let me know if you still have problem.
by
On 1.3.1 you changed the plugin name from q2am-simple-adverts to q2am-simple-adverts-master..!

What should we do when we upgrade our old one to this? Just delete the old plugin folder and upload new folder????

Thanks
by
Nope, I haven't changed plugin name. It's the same on Store as well as Github Repo. If you have downloaded from Github adds -master automatically to the master repo. You can simply rename the plugin folder if needed. However, it shouldn't matter. Or you can Clone it.

Updating Plugin:

You can either delete old files and place new or you can override existing one.
by
ah. Ok I did not know github adds master extension to the file... :)
...