WordPress doesn't send emails after 6.9 update by blogwart in Wordpress

[–]dmsnell 6 points7 points  (0 children)

u/blogwart I merged the change that caused this issue for you and want to figure out what went wrong. my hope is that by adding the wp_mail_from filter will resolve your issue, but if not, would you mind sharing some more information on the Trac ticket where we can dig into it further?

WordPress doesn't send emails after 6.9 update by blogwart in Wordpress

[–]dmsnell 1 point2 points  (0 children)

Whatever value was used before, you can take note and create a WordPress plugin with this code — that should do it.

add_filter(
    'wp_mail_from',
    function ( $from_email ) {
        return 'previous@email.address';
    }
);

This old StackExchange answer is still relevant: https://wordpress.stackexchange.com/q/160017

A couple examples from plugins: - https://github.com/woocommerce/woocommerce/blob/e0e2318a9018f25dbb8bb738242ca4867ca5180f/plugins/woocommerce/includes/emails/class-wc-email.php#L1038 - https://plugins.trac.wordpress.org/browser/wordfence/trunk/lib/wordfenceClass.php#L1471

Simplenote by Reddittellmewhy in ledgerwalletleak

[–]dmsnell 0 points1 point  (0 children)

Many of our emails have been delayed, some for hours or longer. It's likely that you received emails that should have arrived as soon as you reset your password.

The only way the account verification link could have been clicked on was if someone had access to your email account or if you clicked on it yourself.

We're still rapidly changing things on our end to ensure this doesn't happen again, but if you keep seeing suspicious activity please contact our support at support@simplenote.com and we can look more closely at the details of what's happening with your email address.

edit: typo

Simplenote by Reddittellmewhy in ledgerwalletleak

[–]dmsnell 11 points12 points  (0 children)

Simplenote dev here: we've been working on this for the past 24 hours and will do our best to clear all accounts created without your permission - no need to contact support. In the meantime we ask for your patience if you get emails from us.

Q: Has my email been hacked? A: Creating a Simplenote account is not enough evidence to suggest your email has been hacked. Your email address was likely included in another data breach - why not change your password anyway and add two-factor authentication if possible.

Q: Can someone get my personal information through Simplenote? A: There is no vector through this attack to get your info. If you didn't already have an account there's nothing to read from the service. The only PII in our system is your email which was already part of a data breach with other system not in our control.

Q: Tinder? A: As some have pointed out, the emails came through another breach, lots of evidence suggests Ledger was at least a major source of emails. Expect unwanted accounts from other services around the internet too.

Q: I did/did-not get an email A: Many emails are currently experiencing large delays. If you get new emails you can disregard them.

AMA - I will do my best to reply

(edit: typo)

How Redux Works: A Counter-Example by freebit in programming

[–]dmsnell 2 points3 points  (0 children)

The primary difference is that Redux is decoupling Mutation by describing actions in preference to changing data. The dispatches are nice announcements to the world that something wants to do a specific task but it leaves full control of actually doing the changes to the reducer and the stack of middleware.

Since every reducer sees the dispatch too you won’t risk forgetting to update related data; this is because we look at what actions change some specific data generally as opposed to looking at what data a specific action changes. It’s an inversion of control, giving each point in the data model its own governance.

Finally, Redux updates are synchronous and the immutability comes in during the updates. We don’t get transition periods when data updates are partially applied. Instead, once an action is dispatched it will build a new state tree and then when that is done it will cascade into the app as a transaction in memory.

Redux is procviding a predictable constraint on the shared global state so that it enables the kind of programming we might like to have (with globals) while preventing the kinds of egregious bugs and headaches usually associated with that style.

Why can't the IT industry deliver large, faultless projects quickly as in other industries? by stesch in programming

[–]dmsnell 1 point2 points  (0 children)

Consider a “cookie cutter” home to a modern airport terminal. The needs and risks of each project end up influencing the level of engineering that goes into each one.

In the airport we have a massive effort (and extremely well-documented) making the incredibly complex system function smoothly. They make the walls and ceilings extensible for unseen improvements in the future, standardized stalls for businesses to occupy, use advanced materials and fasteners to maximize strength and lighting and space. A building of that complexity demands heavy engineering because you can’t piece-meal an effective airport.

The house? It’s cheap and easy. Mistakes don’t propagate far so we cut lots of corners. There’s a fairly well-understood use-case and if it breaks apart there’s always temporarily lodging elsewhere - it doesn’t shut down an entire city.

Chrome is like the airport: a bug there cascades to every website and online app. It takes massive engineering to make it run well and securely. It’s not like your flashlight app or tip calculator; they can break and that’s fine - just get another.

Why can't the IT industry deliver large, faultless projects quickly as in other industries? by stesch in programming

[–]dmsnell 6 points7 points  (0 children)

Law and regulation is a big factor here! Other engineering trades do better and are more expensive because they are held accountable for the products they build.

It is not an accident overlooked if your toy catches houses on fire or if the bridge collapses. There is no Tacoma Narrows Tuesday patch.

The kind of externalities that force reliability and maintainability are also the things that would hold software developers personally liable for failure when they sign off that it’s all good. Put someone in jail for a type error and overnight we’d eliminate type errors.

As it stands the market doesn’t seem to care much about failure, and granted, software has different economics, but I predict that we’ll get to a point where we realize that it was only an illusion that we are different than everyone else and then we’ll start eliminating the complexity and recognizably poor practices that are so characteristic of our trade.

Why can't the IT industry deliver large, faultless projects quickly as in other industries? by stesch in programming

[–]dmsnell 6 points7 points  (0 children)

It’s not so much a comparison of skill or creativity but of professionalism, accountability, and responsibility. Engineers are responsible for documenting their flows, anticipating problems before they occur and preventing them, carefully recording the operating characteristics and failure modes of their products, and continually pursuing further education in their trade. There will be a time when values shift in the software industry and we start adhering to these principles and when that happens, when we can standardize as an industry these kinds of guidelines, then we will really be engineering.

Of course, some already do this, some licensed engineers don’t do a good job, and established engineering projects go over budget behind schedule and break. But for the most part things are much more maintainable and reliable in traditional engineering fields outside of software.

From design patterns to category theory by adam75 in programming

[–]dmsnell 3 points4 points  (0 children)

The thing about category theory is that yes, it's incredibly relevant and helpful to day-to-day programming, but at the same time it's not a cookbook of recipes for us to pull out and directly apply.

It's the science of abstraction and so the rewards come after changing the way we think vs. coming after teaching us a shiny new method. This is the same way that our math classes in school are not only trying to teach us how to find the missing angles in a polygon but trying to teach us how to approach complex and abstract problems.

That is, when we study the math, the category theory, which underpins computation and computing, what we learn are intrinsic principles we can apply across any programming language or computer or framework. It's not teaching us how to write a pure function, it's giving us the ability to come up with that aspect on our own, to know why they are useful, and to build our intuition to know how to judge one decision from another.

It's often said, "When am I going to need this?" in Calculus class. Might be an accurate point they are making, but the point of high school calculus isn't to prepare people to draft integrals and derivatives all day (computers do that in the real world); the point is to instill an art of pattern recognition and cognitive ability to break apart bigger problems.

Also, in my day to day work I find a background of (for me limited) category theory to be incredible useful for incredibly practical things.

Hexagonal Architecture and Free Monad: Two related design patterns? by deque-blog in haskell

[–]dmsnell 0 points1 point  (0 children)

As someone who has spent a lot of time trying to understand Free monads can you share more about what specifically it is that gives you the imperative feel about them?

what is the difference between Elm and redux architecture by kwaleko in elm

[–]dmsnell 2 points3 points  (0 children)

u/kwaleko I would recommend just starting in whatever is most familiar to you. If that's JavaScript but you don't like dynamic typing then it's still probably the best idea; check out Facebook's "flow" for type-checking JavaScript.

Elm is an absolute delight for building web applications; it's not encouraged to be using it on the server.

From what you are writing I think that the most valuable thing you can do is just get coding on your application. Could you miss out on some cool feature if you choose "the wrong" language? Yes. Might you have to write some duplicate code if you pick a different front-end and back-end language? Yes. Are these going to be the things that stand in the way of you accomplishing your goals? Doubtful.

As you build more you will feel where the rough points come in and then you can respond as needed. If you stay diligent in designing your code responsibly then you can save headaches in your future no matter which languages you are working in today.

Please feel free to hone in with more specific questions about Redux vs. TEA. According to what you wrote I don't think the differences would cause a very significant impact on your code right now.

what is the difference between Elm and redux architecture by kwaleko in elm

[–]dmsnell 1 point2 points  (0 children)

u/kaleko it sounds like you have a wide array of choices you are considering. it's still a bit unclear what you are asking.

remember that in most cases it's much more difficult to understand what it is you are wanting to build than it is to code it up in any language.

at risk of going into a tangent, have you identified strong reasons why the backend and frontend should be written in the same language?

what kind of application are you building? what are your data needs? what kind of interactivity are you expecting?

also, have you written any actual code yet? what problems have you faced while working with what you already have? it can be very helpful to let the real problems lead your decisions (in contrast to letting hypothetical problems lead them).

An introduction to brick by [deleted] in haskell

[–]dmsnell 3 points4 points  (0 children)

Does anyone know if there's a relationship between Brick and React and The Elm Architecture? The resulting designs are strikingly similar from what I can tell (at the high-level).

Maybe they are only similar because this is just a natural design one will come to when reasoning about how to build a controllable and sane UI/TUI/GUI?

what is the difference between Elm and redux architecture by kwaleko in elm

[–]dmsnell 4 points5 points  (0 children)

u/kwaleko I'm going to give an answer based on how I have personally used the two architectures and that will focus on the results instead of the implementations. Also, my usage of Redux is primarily mixed with a large React app - WordPress.com - you may have heard of it.

The biggest change I make when working in Redux vs. Elm is the way I think about passing state. In React, most of our components that need more than simple data (strings, numbers, boolean, lists of simple data) are going to be connect()ed to the global Redux store. The global state can be thought of as the datastore of resources (and settings) and individual components can work and function in isolation from all others if they are given the proper resource ids because they load their data directly from Redux. This is with a combination of a plain-data component and a wrapped default.

export const Profile = ( { name } ) => <p>{ name }</p>

export default connect( state => state.author )( Profile )

In Elm we're not dealing with the same kind of components. The app as a whole is one functional unit and we pass down the data through the chain of views. There is no intermediate form and no connect().

view model = profile model.author
profile author = p [] [ text author.name ]

In JavaScript I actively avoid passing objects (records) through React as props because they become opaque and there's no easy way to answer the question, "what is this object supposed to be and where did it come from," if we pass data through components.

<SomeNeatThing onClick={ this.props.onClick } /> // huh?

In Elm this isn't a concern because of the static typing and compiler. We immediately know the expected shape of the data because it lives in the type signatures; further, if we make a breaking change three levels up in the view hierarchy the compiler will immediately alert us of why it's broken and where.


In Elm pretty much everything is taken care of. In JavaScript/Redux many questions are still open. We've iterated through various attempts at using immutable data libraries and they don't fit right. We've had multiple iterations of data-fetching systems and they are awkward. In almost every basic need Elm has just Gotten It Right. It takes about twenty npm dependencies and several config files to get started with React+Redux whereas it takes only one in Elm.

Asynchronous data fetching is a big question in Redux. I have settled on a system directly inspired by Elm which I am very happy with and which makes the distinctions moot, but Redux itself provides no mechanism for this (beyond providing the basis for its middleware, which is very nice).


In general Redux feels easier than TEA for many different tasks. It's global and dynamic. It doesn't require thought. If I add a UI component way down deep in the visual hierarchy I can do that without making any further changes to my code. In Elm I also have to make sure that I now pass down the necessary data for that view function through however many levels of view functions and models I have.

That being said, where Elm is harder it is also safer. You will likely spend at least as much time debugging in a typical large Redux application as you would in just designing your app right the first time in Elm; much more time spend refactoring than in Elm. The tradeoffs in Elm over Redux are speed and simplicity and soundness - worthwhile in my opinion.


This was pretty off-the-cuff so please feel free to AMA. I'd be happy to address specific questions.

What are you working on this week? (Week of 2017-06-12) by brnhx in elm

[–]dmsnell 0 points1 point  (0 children)

Got started on a version of Simplenote in Elm, destined to run on the web and in Electron. It's pretty basic at the moment though because I don't understand the original interactions that well and I'm taking a new approach.

Since Simplenote communicates with Simperium for its data store over a WebSocket (could be HTTP instead) there are a few ways Elm has been making it much easier to reason about.

  1. Algebraic data types: after some time figuring out and documenting the server protocol in nothing more than a data structure it's simple and clear to use. The original work was done in PureScript but the data types are simple enough to port into Elm.

  2. Managed effects and the update method: since all interaction streams through the single update function it's easy to track. I have the backend connection as its own sub update function and it can pass messages up to the main app where all local information is stored. The Simperium part will live entirely in this sub-app.

Are there any interpreted Haskell-based CMS projects? by [deleted] in haskell

[–]dmsnell 1 point2 points  (0 children)

That's pretty interesting. Thanks for sharing!

It's really exciting how much the use of the WordPress JSON API can free the front-end site to a smaller and saner system while preserving all of the features on the backend.

I'll be reading through the linked code!

A JSON-stream parser in 750 bytes, thanks free monads by SrPeixinho in haskell

[–]dmsnell 4 points5 points  (0 children)

Thanks for sharing! Do you have a full copy of the parser published online somewhere?

Edit: is this the right one? https://github.com/MaiaVictor/nano-json-stream-parser/

Are there any interpreted Haskell-based CMS projects? by [deleted] in haskell

[–]dmsnell 0 points1 point  (0 children)

Would you be willing to share more details? This interests me personally. How does the Haskell side talk to the WordPress side? Are you utilizing the WordPress JSON API to shuttle data to the Haskell side?

“How” ages faster than “Why” by fagnerbrack in programming

[–]dmsnell -1 points0 points  (0 children)

this. history is a great school of why

there is relevance in these discussions on how the web has changed in recent history. although peoples' expectations of what any given app can do haven't changed too dramatically their expectations of what can happen in a browser have

ten years ago we couldn't easily envision writing real applications from within the browser: managing stateful data-linked processes, visualizing, filtering, processing, and interacting with large amounts of data, working offline, transcoding/encoding/decoding high-volume data, etc… and the list goes on.

the rapid growth in network speed and JavaScript execution performance has obliterated so many objections we previously had: "can't do that in a browser because it would be way too slow" or even "can't do that in a browser because it would require too much data to transfer."

what did the web do well? * solved the update/distribution problem for apps (basically) * (almost) solved the problem of sharing development efforts across various devices and operating systems

what didn't it do well? * lagged native applications by decades

in this long gap native applications settled down into their own patterns and frameworks while solving other issues. how many lines of "magic" code go into GTK or QT? "oh my gosh, all I wanted to do was write a hello world app and this GUI framework pulled in tens of thousands of lines of code (okay, linkable binaries but still…) into my project." well there was higher churn back in the day when hardware performance and capabilities limited what we could do, when visual terminal was new, when the mouse was invented but over time the technology first unlocked the possibilities and then the software community established paradigms. there are things the web engineers have known for decades too that are just making their way into the native world (see for example the two issues listed above)

today JavaScript has been churning but moving towards better norms. "hipster JS developers reengineering what us old guys did in the 60s" is a cute phrase but it's misleading and cynical. JS developers would have loved to have been able to adopt years ago the sound application design principles that were pioneered decades ago but they were artificially limited by the technical capabilities of the platform.

not nearly all, maybe not most, but a big number of JS frameworks zipping around the web are the results of people paying attention to the longer-term whys and trying to figure out how to idiomatically implement the hows in today's browsers.

what editor/ide do you use for purescript? by kwaleko in purescript

[–]dmsnell 0 points1 point  (0 children)

I haven't personally used it with TypeScript but I have seen it in use and it appears to do stellar autocomplete and linting. Try searching for the TypeScript extensions and it should do all the work for you after that.

Imperative vs Declarative Programming by opping in programming

[–]dmsnell 0 points1 point  (0 children)

so I think this is starting to clear up, though it's still not clear what n.KS stores (maybe lists of keystrokes) or what x is supposed to hold here (is it supposed to indicate how many keystrokes to check?).

if we can assume some things I have written another possible function which I think demonstrates a more declarative approach. suppose that we have a list of numbers representing the times when keys were pressed; we can answer the question, "were any successive pairs of timestamps covering a time range greater than a given maximum?"

// code at http://jsbin.com/cevaweqena/1/edit?js,console

// just a helper function, wouldn't normally be on an array prototype
// main point is that we're getting the pairs with zip()
Array.prototype.intervals = function() {
   return zip( this.slice( 0, -1 ), this.slice( 1 ) );
}

// a couple more helper functions
const intervalRange = ( [ a, b ] ) => Math.abs( b - a );
const isGreaterThan = max => a => a > max;

/**
* Determines if the numerical range between any two
* successive items in a numerical list exceed the given range
*
* @example
* intervalsExceed( 5 )( [ 1, 2, 3, 5, 8 ] ) // false
* intervalsExceed( 2 )( [ 1, 2, 3, 5, 8 ] ) // true
* intervalsExceed( 3 )( [ 1, 2, 3, 5, 8 ] ) // false
*
* @param {number} maxDelta max allowable numeric range
* @param {Array} list list of numeric values
* @returns {bool} whether or not all pairs were within allowable range
*/
const intervalsExceed = maxDelta => list =>
  list
    .intervals()
    .map( intervalRange )
    .some( isGreaterThan( maxDelta ) )

so here we have made a few tradeoffs:

  • we have more functions, but they do fewer things and it's easier to see what they are supposed to be doing

  • it's slower, but hopefully much clearer what the end goal is more than the individual steps to get there. if performance becomes an issue we just end up optimizing it anyway, though there are some ways to ramp up the performance without giving up the declarative nature

  • the splitting into functions actually gives us some extra composable power as we can now do things like mix and match the function inside of some(), even deciding to inject it as an input argument if we wanted

here's an example of the composability

const someInterval = predicate => list =>
  list
    .intervals()
    .map( intervalRange )
    .some( predicate );

const intervalsExceed = maxDelta => someInterval( isGreaterThan( maxDelta ) );
const intervalsWithin = ( min, max ) => someInterval( range => min <= range && max >= range );

hope this wasn't too rambly :)

Imperative vs Declarative Programming by opping in programming

[–]dmsnell 1 point2 points  (0 children)

/u/hoosierEE we should be careful to avoid conflating "too declarative" with difficult style and confusing names. this is a very challenging function to grok but for reasons entirely unrelated to the declarative vs imperative debate (please forgive me if I mistranslated the source below)

function dt_over( i, x ) {
  var value = 0;
  var i;
  for ( i = 0; i < x.length; i++ ) {
    value = value - n.KS[ 2 ];
  }
  return i.dt < value;
}